library(data.table)
library(stringr)

# set working directory to location where replication archive is stored
setwd("")

# read in raw data for Study 1 (conjoint)
responses <- fread("Study1_Raw.csv", header = TRUE, stringsAsFactors = FALSE)

# remove extra headers
responses <- responses[-c(1:2),]

# remove those who did not agree to consent at the beginning OR wanted data
# removed after full information provided at the end (by typing "REMOVE" in 
# a text box)
responses <- responses[which(responses$Q31=="I AGREE" & responses$Q100!="REMOVE" & 
                               responses$Q100!="REMOVE "),]

# recoding demographics

responses$female <- ifelse(as.numeric(responses$gender)==2, 1, 0)

responses$pid3 <- ifelse(as.numeric(responses$political_party)==1 | as.numeric(responses$political_party)==2 |
                           as.numeric(responses$political_party)==3 | as.numeric(responses$political_party)==6, "D", NA)
responses$pid3 <- ifelse(as.numeric(responses$political_party)==5 | as.numeric(responses$political_party)==8 |
                           as.numeric(responses$political_party)==9 | as.numeric(responses$political_party)==10, "R", responses$pid3)
responses$pid3 <- ifelse(as.numeric(responses$political_party)==4, "I", responses$pid3)
responses$pid3 <- ifelse(as.numeric(responses$political_party)==7, "O", responses$pid3)
responses$pid3 <- relevel(as.factor(responses$pid3), "R")
responses$copart <- ifelse(responses$pid3=="D", 1, NA)
responses$copart <- ifelse(responses$pid3!="D" & !is.na(responses$pid3), 0, responses$copart)

responses$age_bin <- ifelse(as.numeric(responses$age)<30, 1, 0)
responses$age_bin <- ifelse(as.numeric(responses$age)>=30 & as.numeric(responses$age)<50, 2, responses$age_bin)
responses$age_bin <- ifelse(as.numeric(responses$age)>=50 & as.numeric(responses$age)<65, 3, responses$age_bin)
responses$age_bin <- ifelse(as.numeric(responses$age)>=65, 4, responses$age_bin)

responses$hhi <- as.numeric(responses$hhi)

responses$income <- ifelse(responses$hhi>= 1 & responses$hhi <=3, 1, NA)
responses$income <- ifelse(responses$hhi>=4 & responses$hhi <= 8, 2, responses$income)
responses$income <- ifelse(responses$hhi>=9 & responses$hhi <= 13, 3, responses$income)
responses$income <- ifelse(responses$hhi>=14 & responses$hhi <= 18, 4, responses$income)
responses$income <- ifelse(responses$hhi>=19 & responses$hhi <= 22, 5, responses$income)
responses$income <- ifelse(responses$hhi >= 23, 6, responses$income)

responses$ethnicity <- as.numeric(responses$ethnicity)

responses$white_nh <- ifelse(responses$ethnicity==1 & responses$hispanic==1, 1, 0)
responses$white_h <- ifelse(responses$ethnicity==1 & responses$hispanic>1 & responses$hispanic!=15, 1, 0)
responses$black_nh <- ifelse(responses$ethnicity==2 & responses$hispanic==1, 1, 0)
responses$black_h <- ifelse(responses$ethnicity==2 & responses$hispanic>1 & responses$hispanic!=15, 1, 0)
responses$asian <- ifelse(responses$ethnicity>=4 & responses$ethnicity<=10, 1, 0)
responses$other <- ifelse(responses$ethnicity==3 | responses$ethnicity>10, 1, 0)

responses$educ <- ifelse(responses$education==1, 1, NA)
responses$educ <- ifelse(responses$education==2, 2, responses$educ)
responses$educ <- ifelse(responses$education==3, 3, responses$educ)
responses$educ <- ifelse(responses$education==4, 3, responses$educ)
responses$educ <- ifelse(responses$education==5, 3, responses$educ)
responses$educ <- ifelse(responses$education==6, 4, responses$educ)
responses$educ <- ifelse(responses$education==7, 5, responses$educ)
responses$educ <- ifelse(responses$education==8, 5, responses$educ)

responses$ideology <- ifelse(responses$Q45=="Very conservative", 1, NA)
responses$ideology <- ifelse(responses$Q45=="Conservative", 2, responses$ideology)
responses$ideology <- ifelse(responses$Q45=="Slightly conservative", 3, responses$ideology)
responses$ideology <- ifelse(responses$Q45=="Moderate", 4, responses$ideology)
responses$ideology <- ifelse(responses$Q45=="Slightly liberal", 5, responses$ideology)
responses$ideology <- ifelse(responses$Q45=="Liberal", 6, responses$ideology)
responses$ideology <- ifelse(responses$Q45=="Very liberal", 7, responses$ideology)

# coding the correct and incorrect responses to the two attention check questions

responses$attention1 <- ifelse(str_detect(responses$Q2, "Yahoo! News") &
                                 str_detect(responses$Q2, "CNN.com") &
                                 !str_detect(responses$Q2, "ABC News website") &
                                 !str_detect(responses$Q2, "NBC News website") &
                                 !str_detect(responses$Q2, "FoxNews.com") &
                                 !str_detect(responses$Q2, "MSNBC.com") &
                                 !str_detect(responses$Q2, "The Associated Press (AP) website") &
                                 !str_detect(responses$Q2, "The Drudge Report") &
                                 !str_detect(responses$Q2, "National Public Radio (NPR) website") &
                                 !str_detect(responses$Q2, "Washington Post website") &
                                 !str_detect(responses$Q2, "USA Today website") &
                                 !str_detect(responses$Q2, "Reuters website") &
                                 !str_detect(responses$Q2, "New York Times website") &
                                 !str_detect(responses$Q2, "CBS News website") &
                                 !str_detect(responses$Q2, "New York Post Online") &
                                 !str_detect(responses$Q2, "Google News") &
                                 !str_detect(responses$Q2, "Huffington Post website") &
                                 !str_detect(responses$Q2, "None of these websites"),
                               1, 0)

responses$attention2 <- ifelse(str_detect(responses$Q38, "Sparks Fly") &
                                 str_detect(responses$Q38, "We Were Happy") &
                                 !str_detect(responses$Q38, "All Too Well") &
                                 !str_detect(responses$Q38, "Love Story") &
                                 !str_detect(responses$Q38, "willow") &
                                 !str_detect(responses$Q38, "Shake It Off") &
                                 !str_detect(responses$Q38, "All Too Well (10 Minute Version)") &
                                 !str_detect(responses$Q38, "Bejeweled") &
                                 !str_detect(responses$Q38, "Teardrops on My Guitar") &
                                 !str_detect(responses$Q38, "Blank Space") &
                                 !str_detect(responses$Q38, "the one") &
                                 !str_detect(responses$Q38, "Lover") &
                                 !str_detect(responses$Q38, "Midnight Rain") &
                                 !str_detect(responses$Q38, "Me!") &
                                 !str_detect(responses$Q38, "You Belong with Me") &
                                 !str_detect(responses$Q38, "Delicate") &
                                 !str_detect(responses$Q38, "None of these songs"),
                               1, 0)

# summing attention check passage to create an additive score (0 to 2)
responses$attentiveness <- responses$attention1 + responses$attention2

# creating empty slots for the levels of each attribute in each task

responses$task1_profile1_temp <- NA
responses$task1_profile1_attractions <- NA
responses$task1_profile1_traveltime <- NA
responses$task1_profile1_preselec <- NA
responses$task1_profile1_recentnews <- NA
responses$task1_profile1_community <- NA
responses$task1_profile2_temp <- NA
responses$task1_profile2_attractions <- NA
responses$task1_profile2_traveltime <- NA
responses$task1_profile2_preselec <- NA
responses$task1_profile2_recentnews <- NA
responses$task1_profile2_community <- NA
responses$task1_profile3_temp <- NA
responses$task1_profile3_attractions <- NA
responses$task1_profile3_traveltime <- NA
responses$task1_profile3_preselec <- NA
responses$task1_profile3_recentnews <- NA
responses$task1_profile3_community <- NA
responses$task2_profile1_temp <- NA
responses$task2_profile1_attractions <- NA
responses$task2_profile1_traveltime <- NA
responses$task2_profile1_preselec <- NA
responses$task2_profile1_recentnews <- NA
responses$task2_profile1_community <- NA
responses$task2_profile2_temp <- NA
responses$task2_profile2_attractions <- NA
responses$task2_profile2_traveltime <- NA
responses$task2_profile2_preselec <- NA
responses$task2_profile2_recentnews <- NA
responses$task2_profile2_community <- NA
responses$task2_profile3_temp <- NA
responses$task2_profile3_attractions <- NA
responses$task2_profile3_traveltime <- NA
responses$task2_profile3_preselec <- NA
responses$task2_profile3_recentnews <- NA
responses$task2_profile3_community <- NA
responses$task3_profile1_temp <- NA
responses$task3_profile1_attractions <- NA
responses$task3_profile1_traveltime <- NA
responses$task3_profile1_preselec <- NA
responses$task3_profile1_recentnews <- NA
responses$task3_profile1_community <- NA
responses$task3_profile2_temp <- NA
responses$task3_profile2_attractions <- NA
responses$task3_profile2_traveltime <- NA
responses$task3_profile2_preselec <- NA
responses$task3_profile2_recentnews <- NA
responses$task3_profile2_community <- NA
responses$task3_profile3_temp <- NA
responses$task3_profile3_attractions <- NA
responses$task3_profile3_traveltime <- NA
responses$task3_profile3_preselec <- NA
responses$task3_profile3_recentnews <- NA
responses$task3_profile3_community <- NA
responses$task4_profile1_temp <- NA
responses$task4_profile1_attractions <- NA
responses$task4_profile1_traveltime <- NA
responses$task4_profile1_preselec <- NA
responses$task4_profile1_recentnews <- NA
responses$task4_profile1_community <- NA
responses$task4_profile2_temp <- NA
responses$task4_profile2_attractions <- NA
responses$task4_profile2_traveltime <- NA
responses$task4_profile2_preselec <- NA
responses$task4_profile2_recentnews <- NA
responses$task4_profile2_community <- NA
responses$task4_profile3_temp <- NA
responses$task4_profile3_attractions <- NA
responses$task4_profile3_traveltime <- NA
responses$task4_profile3_preselec <- NA
responses$task4_profile3_recentnews <- NA
responses$task4_profile3_community <- NA
responses$task5_profile1_temp <- NA
responses$task5_profile1_attractions <- NA
responses$task5_profile1_traveltime <- NA
responses$task5_profile1_preselec <- NA
responses$task5_profile1_recentnews <- NA
responses$task5_profile1_community <- NA
responses$task5_profile2_temp <- NA
responses$task5_profile2_attractions <- NA
responses$task5_profile2_traveltime <- NA
responses$task5_profile2_preselec <- NA
responses$task5_profile2_recentnews <- NA
responses$task5_profile2_community <- NA
responses$task5_profile3_temp <- NA
responses$task5_profile3_attractions <- NA
responses$task5_profile3_traveltime <- NA
responses$task5_profile3_preselec <- NA
responses$task5_profile3_recentnews <- NA
responses$task5_profile3_community <- NA
responses$task6_profile1_temp <- NA
responses$task6_profile1_attractions <- NA
responses$task6_profile1_traveltime <- NA
responses$task6_profile1_preselec <- NA
responses$task6_profile1_recentnews <- NA
responses$task6_profile1_community <- NA
responses$task6_profile2_temp <- NA
responses$task6_profile2_attractions <- NA
responses$task6_profile2_traveltime <- NA
responses$task6_profile2_preselec <- NA
responses$task6_profile2_recentnews <- NA
responses$task6_profile2_community <- NA
responses$task6_profile3_temp <- NA
responses$task6_profile3_attractions <- NA
responses$task6_profile3_traveltime <- NA
responses$task6_profile3_preselec <- NA
responses$task6_profile3_recentnews <- NA
responses$task6_profile3_community <- NA
responses$task7_profile1_temp <- NA
responses$task7_profile1_attractions <- NA
responses$task7_profile1_traveltime <- NA
responses$task7_profile1_preselec <- NA
responses$task7_profile1_recentnews <- NA
responses$task7_profile1_community <- NA
responses$task7_profile2_temp <- NA
responses$task7_profile2_attractions <- NA
responses$task7_profile2_traveltime <- NA
responses$task7_profile2_preselec <- NA
responses$task7_profile2_recentnews <- NA
responses$task7_profile2_community <- NA
responses$task7_profile3_temp <- NA
responses$task7_profile3_attractions <- NA
responses$task7_profile3_traveltime <- NA
responses$task7_profile3_preselec <- NA
responses$task7_profile3_recentnews <- NA
responses$task7_profile3_community <- NA
responses$task8_profile1_temp <- NA
responses$task8_profile1_attractions <- NA
responses$task8_profile1_traveltime <- NA
responses$task8_profile1_preselec <- NA
responses$task8_profile1_recentnews <- NA
responses$task8_profile1_community <- NA
responses$task8_profile2_temp <- NA
responses$task8_profile2_attractions <- NA
responses$task8_profile2_traveltime <- NA
responses$task8_profile2_preselec <- NA
responses$task8_profile2_recentnews <- NA
responses$task8_profile2_community <- NA
responses$task8_profile3_temp <- NA
responses$task8_profile3_attractions <- NA
responses$task8_profile3_traveltime <- NA
responses$task8_profile3_preselec <- NA
responses$task8_profile3_recentnews <- NA
responses$task8_profile3_community <- NA
responses$task9_profile1_temp <- NA
responses$task9_profile1_attractions <- NA
responses$task9_profile1_traveltime <- NA
responses$task9_profile1_preselec <- NA
responses$task9_profile1_recentnews <- NA
responses$task9_profile1_community <- NA
responses$task9_profile2_temp <- NA
responses$task9_profile2_attractions <- NA
responses$task9_profile2_traveltime <- NA
responses$task9_profile2_preselec <- NA
responses$task9_profile2_recentnews <- NA
responses$task9_profile2_community <- NA
responses$task9_profile3_temp <- NA
responses$task9_profile3_attractions <- NA
responses$task9_profile3_traveltime <- NA
responses$task9_profile3_preselec <- NA
responses$task9_profile3_recentnews <- NA
responses$task9_profile3_community <- NA
responses$task10_profile1_temp <- NA
responses$task10_profile1_attractions <- NA
responses$task10_profile1_traveltime <- NA
responses$task10_profile1_preselec <- NA
responses$task10_profile1_recentnews <- NA
responses$task10_profile1_community <- NA
responses$task10_profile2_temp <- NA
responses$task10_profile2_attractions <- NA
responses$task10_profile2_traveltime <- NA
responses$task10_profile2_preselec <- NA
responses$task10_profile2_recentnews <- NA
responses$task10_profile2_community <- NA
responses$task10_profile3_temp <- NA
responses$task10_profile3_attractions <- NA
responses$task10_profile3_traveltime <- NA
responses$task10_profile3_preselec <- NA
responses$task10_profile3_recentnews <- NA
responses$task10_profile3_community <- NA

# Because the order of each attribute in each task is randomized, we need to
# determine where each attribute is located in the conjoint table in each task
# to appropriately code which attribute-levels were seen in which profiles
# by each respondent.  The following for loop cycles through each vector which
# contains the attribute identifier (e.g., F-1-1) to determine which attribute
# was located in that position, and, if the attribute presented matches each
# attribute listed in the "if" statement, it assigns the attribute-levels to the
# appropriate empty slots constructed above.

for(i in 1:dim(responses)[1]){
  if(responses$`F-1-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task1_profile1_temp[i] <- responses$`F-1-1-1`[i]
    responses$task1_profile2_temp[i] <- responses$`F-1-2-1`[i]
    responses$task1_profile3_temp[i] <- responses$`F-1-3-1`[i]
  }
  if(responses$`F-1-1`[i]=="Most popular tourist attractions"){
    responses$task1_profile1_attractions[i] <- responses$`F-1-1-1`[i]
    responses$task1_profile2_attractions[i] <- responses$`F-1-2-1`[i]
    responses$task1_profile3_attractions[i] <- responses$`F-1-3-1`[i]
  }
  if(responses$`F-1-1`[i]=="Travel time from your home (by air)"){
    responses$task1_profile1_traveltime[i] <- responses$`F-1-1-1`[i]
    responses$task1_profile2_traveltime[i] <- responses$`F-1-2-1`[i]
    responses$task1_profile3_traveltime[i] <- responses$`F-1-3-1`[i]
  }
  if(responses$`F-1-1`[i]=="State-level 2020 presidential election result"){
    responses$task1_profile1_preselec[i] <- responses$`F-1-1-1`[i]
    responses$task1_profile2_preselec[i] <- responses$`F-1-2-1`[i]
    responses$task1_profile3_preselec[i] <- responses$`F-1-3-1`[i]
  }
  if(responses$`F-1-1`[i]=="Recent state news"){
    responses$task1_profile1_recentnews[i] <- responses$`F-1-1-1`[i]
    responses$task1_profile2_recentnews[i] <- responses$`F-1-2-1`[i]
    responses$task1_profile3_recentnews[i] <- responses$`F-1-3-1`[i]
  }
  if(responses$`F-1-1`[i]=="Destination community type"){
    responses$task1_profile1_community[i] <- responses$`F-1-1-1`[i]
    responses$task1_profile2_community[i] <- responses$`F-1-2-1`[i]
    responses$task1_profile3_community[i] <- responses$`F-1-3-1`[i]
  }
  if(responses$`F-1-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task1_profile1_temp[i] <- responses$`F-1-1-2`[i]
    responses$task1_profile2_temp[i] <- responses$`F-1-2-2`[i]
    responses$task1_profile3_temp[i] <- responses$`F-1-3-2`[i]
  }
  if(responses$`F-1-2`[i]=="Most popular tourist attractions"){
    responses$task1_profile1_attractions[i] <- responses$`F-1-1-2`[i]
    responses$task1_profile2_attractions[i] <- responses$`F-1-2-2`[i]
    responses$task1_profile3_attractions[i] <- responses$`F-1-3-2`[i]
  }
  if(responses$`F-1-2`[i]=="Travel time from your home (by air)"){
    responses$task1_profile1_traveltime[i] <- responses$`F-1-1-2`[i]
    responses$task1_profile2_traveltime[i] <- responses$`F-1-2-2`[i]
    responses$task1_profile3_traveltime[i] <- responses$`F-1-3-2`[i]
  }
  if(responses$`F-1-2`[i]=="State-level 2020 presidential election result"){
    responses$task1_profile1_preselec[i] <- responses$`F-1-1-2`[i]
    responses$task1_profile2_preselec[i] <- responses$`F-1-2-2`[i]
    responses$task1_profile3_preselec[i] <- responses$`F-1-3-2`[i]
  }
  if(responses$`F-1-2`[i]=="Recent state news"){
    responses$task1_profile1_recentnews[i] <- responses$`F-1-1-2`[i]
    responses$task1_profile2_recentnews[i] <- responses$`F-1-2-2`[i]
    responses$task1_profile3_recentnews[i] <- responses$`F-1-3-2`[i]
  }
  if(responses$`F-1-2`[i]=="Destination community type"){
    responses$task1_profile1_community[i] <- responses$`F-1-1-2`[i]
    responses$task1_profile2_community[i] <- responses$`F-1-2-2`[i]
    responses$task1_profile3_community[i] <- responses$`F-1-3-2`[i]
  }
  if(responses$`F-1-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task1_profile1_temp[i] <- responses$`F-1-1-3`[i]
    responses$task1_profile2_temp[i] <- responses$`F-1-2-3`[i]
    responses$task1_profile3_temp[i] <- responses$`F-1-3-3`[i]
  }
  if(responses$`F-1-3`[i]=="Most popular tourist attractions"){
    responses$task1_profile1_attractions[i] <- responses$`F-1-1-3`[i]
    responses$task1_profile2_attractions[i] <- responses$`F-1-2-3`[i]
    responses$task1_profile3_attractions[i] <- responses$`F-1-3-3`[i]
  }
  if(responses$`F-1-3`[i]=="Travel time from your home (by air)"){
    responses$task1_profile1_traveltime[i] <- responses$`F-1-1-3`[i]
    responses$task1_profile2_traveltime[i] <- responses$`F-1-2-3`[i]
    responses$task1_profile3_traveltime[i] <- responses$`F-1-3-3`[i]
  }
  if(responses$`F-1-3`[i]=="State-level 2020 presidential election result"){
    responses$task1_profile1_preselec[i] <- responses$`F-1-1-3`[i]
    responses$task1_profile2_preselec[i] <- responses$`F-1-2-3`[i]
    responses$task1_profile3_preselec[i] <- responses$`F-1-3-3`[i]
  }
  if(responses$`F-1-3`[i]=="Recent state news"){
    responses$task1_profile1_recentnews[i] <- responses$`F-1-1-3`[i]
    responses$task1_profile2_recentnews[i] <- responses$`F-1-2-3`[i]
    responses$task1_profile3_recentnews[i] <- responses$`F-1-3-3`[i]
  }
  if(responses$`F-1-3`[i]=="Destination community type"){
    responses$task1_profile1_community[i] <- responses$`F-1-1-3`[i]
    responses$task1_profile2_community[i] <- responses$`F-1-2-3`[i]
    responses$task1_profile3_community[i] <- responses$`F-1-3-3`[i]
  }
  if(responses$`F-1-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task1_profile1_temp[i] <- responses$`F-1-1-4`[i]
    responses$task1_profile2_temp[i] <- responses$`F-1-2-4`[i]
    responses$task1_profile3_temp[i] <- responses$`F-1-3-4`[i]
  }
  if(responses$`F-1-4`[i]=="Most popular tourist attractions"){
    responses$task1_profile1_attractions[i] <- responses$`F-1-1-4`[i]
    responses$task1_profile2_attractions[i] <- responses$`F-1-2-4`[i]
    responses$task1_profile3_attractions[i] <- responses$`F-1-3-4`[i]
  }
  if(responses$`F-1-4`[i]=="Travel time from your home (by air)"){
    responses$task1_profile1_traveltime[i] <- responses$`F-1-1-4`[i]
    responses$task1_profile2_traveltime[i] <- responses$`F-1-2-4`[i]
    responses$task1_profile3_traveltime[i] <- responses$`F-1-3-4`[i]
  }
  if(responses$`F-1-4`[i]=="State-level 2020 presidential election result"){
    responses$task1_profile1_preselec[i] <- responses$`F-1-1-4`[i]
    responses$task1_profile2_preselec[i] <- responses$`F-1-2-4`[i]
    responses$task1_profile3_preselec[i] <- responses$`F-1-3-4`[i]
  }
  if(responses$`F-1-4`[i]=="Recent state news"){
    responses$task1_profile1_recentnews[i] <- responses$`F-1-1-4`[i]
    responses$task1_profile2_recentnews[i] <- responses$`F-1-2-4`[i]
    responses$task1_profile3_recentnews[i] <- responses$`F-1-3-4`[i]
  }
  if(responses$`F-1-4`[i]=="Destination community type"){
    responses$task1_profile1_community[i] <- responses$`F-1-1-4`[i]
    responses$task1_profile2_community[i] <- responses$`F-1-2-4`[i]
    responses$task1_profile3_community[i] <- responses$`F-1-3-4`[i]
  }
  if(responses$`F-1-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task1_profile1_temp[i] <- responses$`F-1-1-5`[i]
    responses$task1_profile2_temp[i] <- responses$`F-1-2-5`[i]
    responses$task1_profile3_temp[i] <- responses$`F-1-3-5`[i]
  }
  if(responses$`F-1-5`[i]=="Most popular tourist attractions"){
    responses$task1_profile1_attractions[i] <- responses$`F-1-1-5`[i]
    responses$task1_profile2_attractions[i] <- responses$`F-1-2-5`[i]
    responses$task1_profile3_attractions[i] <- responses$`F-1-3-5`[i]
  }
  if(responses$`F-1-5`[i]=="Travel time from your home (by air)"){
    responses$task1_profile1_traveltime[i] <- responses$`F-1-1-5`[i]
    responses$task1_profile2_traveltime[i] <- responses$`F-1-2-5`[i]
    responses$task1_profile3_traveltime[i] <- responses$`F-1-3-5`[i]
  }
  if(responses$`F-1-5`[i]=="State-level 2020 presidential election result"){
    responses$task1_profile1_preselec[i] <- responses$`F-1-1-5`[i]
    responses$task1_profile2_preselec[i] <- responses$`F-1-2-5`[i]
    responses$task1_profile3_preselec[i] <- responses$`F-1-3-5`[i]
  }
  if(responses$`F-1-5`[i]=="Recent state news"){
    responses$task1_profile1_recentnews[i] <- responses$`F-1-1-5`[i]
    responses$task1_profile2_recentnews[i] <- responses$`F-1-2-5`[i]
    responses$task1_profile3_recentnews[i] <- responses$`F-1-3-5`[i]
  }
  if(responses$`F-1-5`[i]=="Destination community type"){
    responses$task1_profile1_community[i] <- responses$`F-1-1-5`[i]
    responses$task1_profile2_community[i] <- responses$`F-1-2-5`[i]
    responses$task1_profile3_community[i] <- responses$`F-1-3-5`[i]
  }
  if(responses$`F-1-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task1_profile1_temp[i] <- responses$`F-1-1-6`[i]
    responses$task1_profile2_temp[i] <- responses$`F-1-2-6`[i]
    responses$task1_profile3_temp[i] <- responses$`F-1-3-6`[i]
  }
  if(responses$`F-1-6`[i]=="Most popular tourist attractions"){
    responses$task1_profile1_attractions[i] <- responses$`F-1-1-6`[i]
    responses$task1_profile2_attractions[i] <- responses$`F-1-2-6`[i]
    responses$task1_profile3_attractions[i] <- responses$`F-1-3-6`[i]
  }
  if(responses$`F-1-6`[i]=="Travel time from your home (by air)"){
    responses$task1_profile1_traveltime[i] <- responses$`F-1-1-6`[i]
    responses$task1_profile2_traveltime[i] <- responses$`F-1-2-6`[i]
    responses$task1_profile3_traveltime[i] <- responses$`F-1-3-6`[i]
  }
  if(responses$`F-1-6`[i]=="State-level 2020 presidential election result"){
    responses$task1_profile1_preselec[i] <- responses$`F-1-1-6`[i]
    responses$task1_profile2_preselec[i] <- responses$`F-1-2-6`[i]
    responses$task1_profile3_preselec[i] <- responses$`F-1-3-6`[i]
  }
  if(responses$`F-1-6`[i]=="Recent state news"){
    responses$task1_profile1_recentnews[i] <- responses$`F-1-1-6`[i]
    responses$task1_profile2_recentnews[i] <- responses$`F-1-2-6`[i]
    responses$task1_profile3_recentnews[i] <- responses$`F-1-3-6`[i]
  }
  if(responses$`F-1-6`[i]=="Destination community type"){
    responses$task1_profile1_community[i] <- responses$`F-1-1-6`[i]
    responses$task1_profile2_community[i] <- responses$`F-1-2-6`[i]
    responses$task1_profile3_community[i] <- responses$`F-1-3-6`[i]
  }
  if(responses$`F-2-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task2_profile1_temp[i] <- responses$`F-2-1-1`[i]
    responses$task2_profile2_temp[i] <- responses$`F-2-2-1`[i]
    responses$task2_profile3_temp[i] <- responses$`F-2-3-1`[i]
  }
  if(responses$`F-2-1`[i]=="Most popular tourist attractions"){
    responses$task2_profile1_attractions[i] <- responses$`F-2-1-1`[i]
    responses$task2_profile2_attractions[i] <- responses$`F-2-2-1`[i]
    responses$task2_profile3_attractions[i] <- responses$`F-2-3-1`[i]
  }
  if(responses$`F-2-1`[i]=="Travel time from your home (by air)"){
    responses$task2_profile1_traveltime[i] <- responses$`F-2-1-1`[i]
    responses$task2_profile2_traveltime[i] <- responses$`F-2-2-1`[i]
    responses$task2_profile3_traveltime[i] <- responses$`F-2-3-1`[i]
  }
  if(responses$`F-2-1`[i]=="State-level 2020 presidential election result"){
    responses$task2_profile1_preselec[i] <- responses$`F-2-1-1`[i]
    responses$task2_profile2_preselec[i] <- responses$`F-2-2-1`[i]
    responses$task2_profile3_preselec[i] <- responses$`F-2-3-1`[i]
  }
  if(responses$`F-2-1`[i]=="Recent state news"){
    responses$task2_profile1_recentnews[i] <- responses$`F-2-1-1`[i]
    responses$task2_profile2_recentnews[i] <- responses$`F-2-2-1`[i]
    responses$task2_profile3_recentnews[i] <- responses$`F-2-3-1`[i]
  }
  if(responses$`F-2-1`[i]=="Destination community type"){
    responses$task2_profile1_community[i] <- responses$`F-2-1-1`[i]
    responses$task2_profile2_community[i] <- responses$`F-2-2-1`[i]
    responses$task2_profile3_community[i] <- responses$`F-2-3-1`[i]
  }
  if(responses$`F-2-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task2_profile1_temp[i] <- responses$`F-2-1-2`[i]
    responses$task2_profile2_temp[i] <- responses$`F-2-2-2`[i]
    responses$task2_profile3_temp[i] <- responses$`F-2-3-2`[i]
  }
  if(responses$`F-2-2`[i]=="Most popular tourist attractions"){
    responses$task2_profile1_attractions[i] <- responses$`F-2-1-2`[i]
    responses$task2_profile2_attractions[i] <- responses$`F-2-2-2`[i]
    responses$task2_profile3_attractions[i] <- responses$`F-2-3-2`[i]
  }
  if(responses$`F-2-2`[i]=="Travel time from your home (by air)"){
    responses$task2_profile1_traveltime[i] <- responses$`F-2-1-2`[i]
    responses$task2_profile2_traveltime[i] <- responses$`F-2-2-2`[i]
    responses$task2_profile3_traveltime[i] <- responses$`F-2-3-2`[i]
  }
  if(responses$`F-2-2`[i]=="State-level 2020 presidential election result"){
    responses$task2_profile1_preselec[i] <- responses$`F-2-1-2`[i]
    responses$task2_profile2_preselec[i] <- responses$`F-2-2-2`[i]
    responses$task2_profile3_preselec[i] <- responses$`F-2-3-2`[i]
  }
  if(responses$`F-2-2`[i]=="Recent state news"){
    responses$task2_profile1_recentnews[i] <- responses$`F-2-1-2`[i]
    responses$task2_profile2_recentnews[i] <- responses$`F-2-2-2`[i]
    responses$task2_profile3_recentnews[i] <- responses$`F-2-3-2`[i]
  }
  if(responses$`F-2-2`[i]=="Destination community type"){
    responses$task2_profile1_community[i] <- responses$`F-2-1-2`[i]
    responses$task2_profile2_community[i] <- responses$`F-2-2-2`[i]
    responses$task2_profile3_community[i] <- responses$`F-2-3-2`[i]
  }
  if(responses$`F-2-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task2_profile1_temp[i] <- responses$`F-2-1-3`[i]
    responses$task2_profile2_temp[i] <- responses$`F-2-2-3`[i]
    responses$task2_profile3_temp[i] <- responses$`F-2-3-3`[i]
  }
  if(responses$`F-2-3`[i]=="Most popular tourist attractions"){
    responses$task2_profile1_attractions[i] <- responses$`F-2-1-3`[i]
    responses$task2_profile2_attractions[i] <- responses$`F-2-2-3`[i]
    responses$task2_profile3_attractions[i] <- responses$`F-2-3-3`[i]
  }
  if(responses$`F-2-3`[i]=="Travel time from your home (by air)"){
    responses$task2_profile1_traveltime[i] <- responses$`F-2-1-3`[i]
    responses$task2_profile2_traveltime[i] <- responses$`F-2-2-3`[i]
    responses$task2_profile3_traveltime[i] <- responses$`F-2-3-3`[i]
  }
  if(responses$`F-2-3`[i]=="State-level 2020 presidential election result"){
    responses$task2_profile1_preselec[i] <- responses$`F-2-1-3`[i]
    responses$task2_profile2_preselec[i] <- responses$`F-2-2-3`[i]
    responses$task2_profile3_preselec[i] <- responses$`F-2-3-3`[i]
  }
  if(responses$`F-2-3`[i]=="Recent state news"){
    responses$task2_profile1_recentnews[i] <- responses$`F-2-1-3`[i]
    responses$task2_profile2_recentnews[i] <- responses$`F-2-2-3`[i]
    responses$task2_profile3_recentnews[i] <- responses$`F-2-3-3`[i]
  }
  if(responses$`F-2-3`[i]=="Destination community type"){
    responses$task2_profile1_community[i] <- responses$`F-2-1-3`[i]
    responses$task2_profile2_community[i] <- responses$`F-2-2-3`[i]
    responses$task2_profile3_community[i] <- responses$`F-2-3-3`[i]
  }
  if(responses$`F-2-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task2_profile1_temp[i] <- responses$`F-2-1-4`[i]
    responses$task2_profile2_temp[i] <- responses$`F-2-2-4`[i]
    responses$task2_profile3_temp[i] <- responses$`F-2-3-4`[i]
  }
  if(responses$`F-2-4`[i]=="Most popular tourist attractions"){
    responses$task2_profile1_attractions[i] <- responses$`F-2-1-4`[i]
    responses$task2_profile2_attractions[i] <- responses$`F-2-2-4`[i]
    responses$task2_profile3_attractions[i] <- responses$`F-2-3-4`[i]
  }
  if(responses$`F-2-4`[i]=="Travel time from your home (by air)"){
    responses$task2_profile1_traveltime[i] <- responses$`F-2-1-4`[i]
    responses$task2_profile2_traveltime[i] <- responses$`F-2-2-4`[i]
    responses$task2_profile3_traveltime[i] <- responses$`F-2-3-4`[i]
  }
  if(responses$`F-2-4`[i]=="State-level 2020 presidential election result"){
    responses$task2_profile1_preselec[i] <- responses$`F-2-1-4`[i]
    responses$task2_profile2_preselec[i] <- responses$`F-2-2-4`[i]
    responses$task2_profile3_preselec[i] <- responses$`F-2-3-4`[i]
  }
  if(responses$`F-2-4`[i]=="Recent state news"){
    responses$task2_profile1_recentnews[i] <- responses$`F-2-1-4`[i]
    responses$task2_profile2_recentnews[i] <- responses$`F-2-2-4`[i]
    responses$task2_profile3_recentnews[i] <- responses$`F-2-3-4`[i]
  }
  if(responses$`F-2-4`[i]=="Destination community type"){
    responses$task2_profile1_community[i] <- responses$`F-2-1-4`[i]
    responses$task2_profile2_community[i] <- responses$`F-2-2-4`[i]
    responses$task2_profile3_community[i] <- responses$`F-2-3-4`[i]
  }
  if(responses$`F-2-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task2_profile1_temp[i] <- responses$`F-2-1-5`[i]
    responses$task2_profile2_temp[i] <- responses$`F-2-2-5`[i]
    responses$task2_profile3_temp[i] <- responses$`F-2-3-5`[i]
  }
  if(responses$`F-2-5`[i]=="Most popular tourist attractions"){
    responses$task2_profile1_attractions[i] <- responses$`F-2-1-5`[i]
    responses$task2_profile2_attractions[i] <- responses$`F-2-2-5`[i]
    responses$task2_profile3_attractions[i] <- responses$`F-2-3-5`[i]
  }
  if(responses$`F-2-5`[i]=="Travel time from your home (by air)"){
    responses$task2_profile1_traveltime[i] <- responses$`F-2-1-5`[i]
    responses$task2_profile2_traveltime[i] <- responses$`F-2-2-5`[i]
    responses$task2_profile3_traveltime[i] <- responses$`F-2-3-5`[i]
  }
  if(responses$`F-2-5`[i]=="State-level 2020 presidential election result"){
    responses$task2_profile1_preselec[i] <- responses$`F-2-1-5`[i]
    responses$task2_profile2_preselec[i] <- responses$`F-2-2-5`[i]
    responses$task2_profile3_preselec[i] <- responses$`F-2-3-5`[i]
  }
  if(responses$`F-2-5`[i]=="Recent state news"){
    responses$task2_profile1_recentnews[i] <- responses$`F-2-1-5`[i]
    responses$task2_profile2_recentnews[i] <- responses$`F-2-2-5`[i]
    responses$task2_profile3_recentnews[i] <- responses$`F-2-3-5`[i]
  }
  if(responses$`F-2-5`[i]=="Destination community type"){
    responses$task2_profile1_community[i] <- responses$`F-2-1-5`[i]
    responses$task2_profile2_community[i] <- responses$`F-2-2-5`[i]
    responses$task2_profile3_community[i] <- responses$`F-2-3-5`[i]
  }
  if(responses$`F-2-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task2_profile1_temp[i] <- responses$`F-2-1-6`[i]
    responses$task2_profile2_temp[i] <- responses$`F-2-2-6`[i]
    responses$task2_profile3_temp[i] <- responses$`F-2-3-6`[i]
  }
  if(responses$`F-2-6`[i]=="Most popular tourist attractions"){
    responses$task2_profile1_attractions[i] <- responses$`F-2-1-6`[i]
    responses$task2_profile2_attractions[i] <- responses$`F-2-2-6`[i]
    responses$task2_profile3_attractions[i] <- responses$`F-2-3-6`[i]
  }
  if(responses$`F-2-6`[i]=="Travel time from your home (by air)"){
    responses$task2_profile1_traveltime[i] <- responses$`F-2-1-6`[i]
    responses$task2_profile2_traveltime[i] <- responses$`F-2-2-6`[i]
    responses$task2_profile3_traveltime[i] <- responses$`F-2-3-6`[i]
  }
  if(responses$`F-2-6`[i]=="State-level 2020 presidential election result"){
    responses$task2_profile1_preselec[i] <- responses$`F-2-1-6`[i]
    responses$task2_profile2_preselec[i] <- responses$`F-2-2-6`[i]
    responses$task2_profile3_preselec[i] <- responses$`F-2-3-6`[i]
  }
  if(responses$`F-2-6`[i]=="Recent state news"){
    responses$task2_profile1_recentnews[i] <- responses$`F-2-1-6`[i]
    responses$task2_profile2_recentnews[i] <- responses$`F-2-2-6`[i]
    responses$task2_profile3_recentnews[i] <- responses$`F-2-3-6`[i]
  }
  if(responses$`F-2-6`[i]=="Destination community type"){
    responses$task2_profile1_community[i] <- responses$`F-2-1-6`[i]
    responses$task2_profile2_community[i] <- responses$`F-2-2-6`[i]
    responses$task2_profile3_community[i] <- responses$`F-2-3-6`[i]
  }
  if(responses$`F-3-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task3_profile1_temp[i] <- responses$`F-3-1-1`[i]
    responses$task3_profile2_temp[i] <- responses$`F-3-2-1`[i]
    responses$task3_profile3_temp[i] <- responses$`F-3-3-1`[i]
  }
  if(responses$`F-3-1`[i]=="Most popular tourist attractions"){
    responses$task3_profile1_attractions[i] <- responses$`F-3-1-1`[i]
    responses$task3_profile2_attractions[i] <- responses$`F-3-2-1`[i]
    responses$task3_profile3_attractions[i] <- responses$`F-3-3-1`[i]
  }
  if(responses$`F-3-1`[i]=="Travel time from your home (by air)"){
    responses$task3_profile1_traveltime[i] <- responses$`F-3-1-1`[i]
    responses$task3_profile2_traveltime[i] <- responses$`F-3-2-1`[i]
    responses$task3_profile3_traveltime[i] <- responses$`F-3-3-1`[i]
  }
  if(responses$`F-3-1`[i]=="State-level 2020 presidential election result"){
    responses$task3_profile1_preselec[i] <- responses$`F-3-1-1`[i]
    responses$task3_profile2_preselec[i] <- responses$`F-3-2-1`[i]
    responses$task3_profile3_preselec[i] <- responses$`F-3-3-1`[i]
  }
  if(responses$`F-3-1`[i]=="Recent state news"){
    responses$task3_profile1_recentnews[i] <- responses$`F-3-1-1`[i]
    responses$task3_profile2_recentnews[i] <- responses$`F-3-2-1`[i]
    responses$task3_profile3_recentnews[i] <- responses$`F-3-3-1`[i]
  }
  if(responses$`F-3-1`[i]=="Destination community type"){
    responses$task3_profile1_community[i] <- responses$`F-3-1-1`[i]
    responses$task3_profile2_community[i] <- responses$`F-3-2-1`[i]
    responses$task3_profile3_community[i] <- responses$`F-3-3-1`[i]
  }
  if(responses$`F-3-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task3_profile1_temp[i] <- responses$`F-3-1-2`[i]
    responses$task3_profile2_temp[i] <- responses$`F-3-2-2`[i]
    responses$task3_profile3_temp[i] <- responses$`F-3-3-2`[i]
  }
  if(responses$`F-3-2`[i]=="Most popular tourist attractions"){
    responses$task3_profile1_attractions[i] <- responses$`F-3-1-2`[i]
    responses$task3_profile2_attractions[i] <- responses$`F-3-2-2`[i]
    responses$task3_profile3_attractions[i] <- responses$`F-3-3-2`[i]
  }
  if(responses$`F-3-2`[i]=="Travel time from your home (by air)"){
    responses$task3_profile1_traveltime[i] <- responses$`F-3-1-2`[i]
    responses$task3_profile2_traveltime[i] <- responses$`F-3-2-2`[i]
    responses$task3_profile3_traveltime[i] <- responses$`F-3-3-2`[i]
  }
  if(responses$`F-3-2`[i]=="State-level 2020 presidential election result"){
    responses$task3_profile1_preselec[i] <- responses$`F-3-1-2`[i]
    responses$task3_profile2_preselec[i] <- responses$`F-3-2-2`[i]
    responses$task3_profile3_preselec[i] <- responses$`F-3-3-2`[i]
  }
  if(responses$`F-3-2`[i]=="Recent state news"){
    responses$task3_profile1_recentnews[i] <- responses$`F-3-1-2`[i]
    responses$task3_profile2_recentnews[i] <- responses$`F-3-2-2`[i]
    responses$task3_profile3_recentnews[i] <- responses$`F-3-3-2`[i]
  }
  if(responses$`F-3-2`[i]=="Destination community type"){
    responses$task3_profile1_community[i] <- responses$`F-3-1-2`[i]
    responses$task3_profile2_community[i] <- responses$`F-3-2-2`[i]
    responses$task3_profile3_community[i] <- responses$`F-3-3-2`[i]
  }
  if(responses$`F-3-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task3_profile1_temp[i] <- responses$`F-3-1-3`[i]
    responses$task3_profile2_temp[i] <- responses$`F-3-2-3`[i]
    responses$task3_profile3_temp[i] <- responses$`F-3-3-3`[i]
  }
  if(responses$`F-3-3`[i]=="Most popular tourist attractions"){
    responses$task3_profile1_attractions[i] <- responses$`F-3-1-3`[i]
    responses$task3_profile2_attractions[i] <- responses$`F-3-2-3`[i]
    responses$task3_profile3_attractions[i] <- responses$`F-3-3-3`[i]
  }
  if(responses$`F-3-3`[i]=="Travel time from your home (by air)"){
    responses$task3_profile1_traveltime[i] <- responses$`F-3-1-3`[i]
    responses$task3_profile2_traveltime[i] <- responses$`F-3-2-3`[i]
    responses$task3_profile3_traveltime[i] <- responses$`F-3-3-3`[i]
  }
  if(responses$`F-3-3`[i]=="State-level 2020 presidential election result"){
    responses$task3_profile1_preselec[i] <- responses$`F-3-1-3`[i]
    responses$task3_profile2_preselec[i] <- responses$`F-3-2-3`[i]
    responses$task3_profile3_preselec[i] <- responses$`F-3-3-3`[i]
  }
  if(responses$`F-3-3`[i]=="Recent state news"){
    responses$task3_profile1_recentnews[i] <- responses$`F-3-1-3`[i]
    responses$task3_profile2_recentnews[i] <- responses$`F-3-2-3`[i]
    responses$task3_profile3_recentnews[i] <- responses$`F-3-3-3`[i]
  }
  if(responses$`F-3-3`[i]=="Destination community type"){
    responses$task3_profile1_community[i] <- responses$`F-3-1-3`[i]
    responses$task3_profile2_community[i] <- responses$`F-3-2-3`[i]
    responses$task3_profile3_community[i] <- responses$`F-3-3-3`[i]
  }
  if(responses$`F-3-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task3_profile1_temp[i] <- responses$`F-3-1-4`[i]
    responses$task3_profile2_temp[i] <- responses$`F-3-2-4`[i]
    responses$task3_profile3_temp[i] <- responses$`F-3-3-4`[i]
  }
  if(responses$`F-3-4`[i]=="Most popular tourist attractions"){
    responses$task3_profile1_attractions[i] <- responses$`F-3-1-4`[i]
    responses$task3_profile2_attractions[i] <- responses$`F-3-2-4`[i]
    responses$task3_profile3_attractions[i] <- responses$`F-3-3-4`[i]
  }
  if(responses$`F-3-4`[i]=="Travel time from your home (by air)"){
    responses$task3_profile1_traveltime[i] <- responses$`F-3-1-4`[i]
    responses$task3_profile2_traveltime[i] <- responses$`F-3-2-4`[i]
    responses$task3_profile3_traveltime[i] <- responses$`F-3-3-4`[i]
  }
  if(responses$`F-3-4`[i]=="State-level 2020 presidential election result"){
    responses$task3_profile1_preselec[i] <- responses$`F-3-1-4`[i]
    responses$task3_profile2_preselec[i] <- responses$`F-3-2-4`[i]
    responses$task3_profile3_preselec[i] <- responses$`F-3-3-4`[i]
  }
  if(responses$`F-3-4`[i]=="Recent state news"){
    responses$task3_profile1_recentnews[i] <- responses$`F-3-1-4`[i]
    responses$task3_profile2_recentnews[i] <- responses$`F-3-2-4`[i]
    responses$task3_profile3_recentnews[i] <- responses$`F-3-3-4`[i]
  }
  if(responses$`F-3-4`[i]=="Destination community type"){
    responses$task3_profile1_community[i] <- responses$`F-3-1-4`[i]
    responses$task3_profile2_community[i] <- responses$`F-3-2-4`[i]
    responses$task3_profile3_community[i] <- responses$`F-3-3-4`[i]
  }
  if(responses$`F-3-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task3_profile1_temp[i] <- responses$`F-3-1-5`[i]
    responses$task3_profile2_temp[i] <- responses$`F-3-2-5`[i]
    responses$task3_profile3_temp[i] <- responses$`F-3-3-5`[i]
  }
  if(responses$`F-3-5`[i]=="Most popular tourist attractions"){
    responses$task3_profile1_attractions[i] <- responses$`F-3-1-5`[i]
    responses$task3_profile2_attractions[i] <- responses$`F-3-2-5`[i]
    responses$task3_profile3_attractions[i] <- responses$`F-3-3-5`[i]
  }
  if(responses$`F-3-5`[i]=="Travel time from your home (by air)"){
    responses$task3_profile1_traveltime[i] <- responses$`F-3-1-5`[i]
    responses$task3_profile2_traveltime[i] <- responses$`F-3-2-5`[i]
    responses$task3_profile3_traveltime[i] <- responses$`F-3-3-5`[i]
  }
  if(responses$`F-3-5`[i]=="State-level 2020 presidential election result"){
    responses$task3_profile1_preselec[i] <- responses$`F-3-1-5`[i]
    responses$task3_profile2_preselec[i] <- responses$`F-3-2-5`[i]
    responses$task3_profile3_preselec[i] <- responses$`F-3-3-5`[i]
  }
  if(responses$`F-3-5`[i]=="Recent state news"){
    responses$task3_profile1_recentnews[i] <- responses$`F-3-1-5`[i]
    responses$task3_profile2_recentnews[i] <- responses$`F-3-2-5`[i]
    responses$task3_profile3_recentnews[i] <- responses$`F-3-3-5`[i]
  }
  if(responses$`F-3-5`[i]=="Destination community type"){
    responses$task3_profile1_community[i] <- responses$`F-3-1-5`[i]
    responses$task3_profile2_community[i] <- responses$`F-3-2-5`[i]
    responses$task3_profile3_community[i] <- responses$`F-3-3-5`[i]
  }
  if(responses$`F-3-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task3_profile1_temp[i] <- responses$`F-3-1-6`[i]
    responses$task3_profile2_temp[i] <- responses$`F-3-2-6`[i]
    responses$task3_profile3_temp[i] <- responses$`F-3-3-6`[i]
  }
  if(responses$`F-3-6`[i]=="Most popular tourist attractions"){
    responses$task3_profile1_attractions[i] <- responses$`F-3-1-6`[i]
    responses$task3_profile2_attractions[i] <- responses$`F-3-2-6`[i]
    responses$task3_profile3_attractions[i] <- responses$`F-3-3-6`[i]
  }
  if(responses$`F-3-6`[i]=="Travel time from your home (by air)"){
    responses$task3_profile1_traveltime[i] <- responses$`F-3-1-6`[i]
    responses$task3_profile2_traveltime[i] <- responses$`F-3-2-6`[i]
    responses$task3_profile3_traveltime[i] <- responses$`F-3-3-6`[i]
  }
  if(responses$`F-3-6`[i]=="State-level 2020 presidential election result"){
    responses$task3_profile1_preselec[i] <- responses$`F-3-1-6`[i]
    responses$task3_profile2_preselec[i] <- responses$`F-3-2-6`[i]
    responses$task3_profile3_preselec[i] <- responses$`F-3-3-6`[i]
  }
  if(responses$`F-3-6`[i]=="Recent state news"){
    responses$task3_profile1_recentnews[i] <- responses$`F-3-1-6`[i]
    responses$task3_profile2_recentnews[i] <- responses$`F-3-2-6`[i]
    responses$task3_profile3_recentnews[i] <- responses$`F-3-3-6`[i]
  }
  if(responses$`F-3-6`[i]=="Destination community type"){
    responses$task3_profile1_community[i] <- responses$`F-3-1-6`[i]
    responses$task3_profile2_community[i] <- responses$`F-3-2-6`[i]
    responses$task3_profile3_community[i] <- responses$`F-3-3-6`[i]
  }
  if(responses$`F-4-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task4_profile1_temp[i] <- responses$`F-4-1-1`[i]
    responses$task4_profile2_temp[i] <- responses$`F-4-2-1`[i]
    responses$task4_profile3_temp[i] <- responses$`F-4-3-1`[i]
  }
  if(responses$`F-4-1`[i]=="Most popular tourist attractions"){
    responses$task4_profile1_attractions[i] <- responses$`F-4-1-1`[i]
    responses$task4_profile2_attractions[i] <- responses$`F-4-2-1`[i]
    responses$task4_profile3_attractions[i] <- responses$`F-4-3-1`[i]
  }
  if(responses$`F-4-1`[i]=="Travel time from your home (by air)"){
    responses$task4_profile1_traveltime[i] <- responses$`F-4-1-1`[i]
    responses$task4_profile2_traveltime[i] <- responses$`F-4-2-1`[i]
    responses$task4_profile3_traveltime[i] <- responses$`F-4-3-1`[i]
  }
  if(responses$`F-4-1`[i]=="State-level 2020 presidential election result"){
    responses$task4_profile1_preselec[i] <- responses$`F-4-1-1`[i]
    responses$task4_profile2_preselec[i] <- responses$`F-4-2-1`[i]
    responses$task4_profile3_preselec[i] <- responses$`F-4-3-1`[i]
  }
  if(responses$`F-4-1`[i]=="Recent state news"){
    responses$task4_profile1_recentnews[i] <- responses$`F-4-1-1`[i]
    responses$task4_profile2_recentnews[i] <- responses$`F-4-2-1`[i]
    responses$task4_profile3_recentnews[i] <- responses$`F-4-3-1`[i]
  }
  if(responses$`F-4-1`[i]=="Destination community type"){
    responses$task4_profile1_community[i] <- responses$`F-4-1-1`[i]
    responses$task4_profile2_community[i] <- responses$`F-4-2-1`[i]
    responses$task4_profile3_community[i] <- responses$`F-4-3-1`[i]
  }
  if(responses$`F-4-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task4_profile1_temp[i] <- responses$`F-4-1-2`[i]
    responses$task4_profile2_temp[i] <- responses$`F-4-2-2`[i]
    responses$task4_profile3_temp[i] <- responses$`F-4-3-2`[i]
  }
  if(responses$`F-4-2`[i]=="Most popular tourist attractions"){
    responses$task4_profile1_attractions[i] <- responses$`F-4-1-2`[i]
    responses$task4_profile2_attractions[i] <- responses$`F-4-2-2`[i]
    responses$task4_profile3_attractions[i] <- responses$`F-4-3-2`[i]
  }
  if(responses$`F-4-2`[i]=="Travel time from your home (by air)"){
    responses$task4_profile1_traveltime[i] <- responses$`F-4-1-2`[i]
    responses$task4_profile2_traveltime[i] <- responses$`F-4-2-2`[i]
    responses$task4_profile3_traveltime[i] <- responses$`F-4-3-2`[i]
  }
  if(responses$`F-4-2`[i]=="State-level 2020 presidential election result"){
    responses$task4_profile1_preselec[i] <- responses$`F-4-1-2`[i]
    responses$task4_profile2_preselec[i] <- responses$`F-4-2-2`[i]
    responses$task4_profile3_preselec[i] <- responses$`F-4-3-2`[i]
  }
  if(responses$`F-4-2`[i]=="Recent state news"){
    responses$task4_profile1_recentnews[i] <- responses$`F-4-1-2`[i]
    responses$task4_profile2_recentnews[i] <- responses$`F-4-2-2`[i]
    responses$task4_profile3_recentnews[i] <- responses$`F-4-3-2`[i]
  }
  if(responses$`F-4-2`[i]=="Destination community type"){
    responses$task4_profile1_community[i] <- responses$`F-4-1-2`[i]
    responses$task4_profile2_community[i] <- responses$`F-4-2-2`[i]
    responses$task4_profile3_community[i] <- responses$`F-4-3-2`[i]
  }
  if(responses$`F-4-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task4_profile1_temp[i] <- responses$`F-4-1-3`[i]
    responses$task4_profile2_temp[i] <- responses$`F-4-2-3`[i]
    responses$task4_profile3_temp[i] <- responses$`F-4-3-3`[i]
  }
  if(responses$`F-4-3`[i]=="Most popular tourist attractions"){
    responses$task4_profile1_attractions[i] <- responses$`F-4-1-3`[i]
    responses$task4_profile2_attractions[i] <- responses$`F-4-2-3`[i]
    responses$task4_profile3_attractions[i] <- responses$`F-4-3-3`[i]
  }
  if(responses$`F-4-3`[i]=="Travel time from your home (by air)"){
    responses$task4_profile1_traveltime[i] <- responses$`F-4-1-3`[i]
    responses$task4_profile2_traveltime[i] <- responses$`F-4-2-3`[i]
    responses$task4_profile3_traveltime[i] <- responses$`F-4-3-3`[i]
  }
  if(responses$`F-4-3`[i]=="State-level 2020 presidential election result"){
    responses$task4_profile1_preselec[i] <- responses$`F-4-1-3`[i]
    responses$task4_profile2_preselec[i] <- responses$`F-4-2-3`[i]
    responses$task4_profile3_preselec[i] <- responses$`F-4-3-3`[i]
  }
  if(responses$`F-4-3`[i]=="Recent state news"){
    responses$task4_profile1_recentnews[i] <- responses$`F-4-1-3`[i]
    responses$task4_profile2_recentnews[i] <- responses$`F-4-2-3`[i]
    responses$task4_profile3_recentnews[i] <- responses$`F-4-3-3`[i]
  }
  if(responses$`F-4-3`[i]=="Destination community type"){
    responses$task4_profile1_community[i] <- responses$`F-4-1-3`[i]
    responses$task4_profile2_community[i] <- responses$`F-4-2-3`[i]
    responses$task4_profile3_community[i] <- responses$`F-4-3-3`[i]
  }
  if(responses$`F-4-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task4_profile1_temp[i] <- responses$`F-4-1-4`[i]
    responses$task4_profile2_temp[i] <- responses$`F-4-2-4`[i]
    responses$task4_profile3_temp[i] <- responses$`F-4-3-4`[i]
  }
  if(responses$`F-4-4`[i]=="Most popular tourist attractions"){
    responses$task4_profile1_attractions[i] <- responses$`F-4-1-4`[i]
    responses$task4_profile2_attractions[i] <- responses$`F-4-2-4`[i]
    responses$task4_profile3_attractions[i] <- responses$`F-4-3-4`[i]
  }
  if(responses$`F-4-4`[i]=="Travel time from your home (by air)"){
    responses$task4_profile1_traveltime[i] <- responses$`F-4-1-4`[i]
    responses$task4_profile2_traveltime[i] <- responses$`F-4-2-4`[i]
    responses$task4_profile3_traveltime[i] <- responses$`F-4-3-4`[i]
  }
  if(responses$`F-4-4`[i]=="State-level 2020 presidential election result"){
    responses$task4_profile1_preselec[i] <- responses$`F-4-1-4`[i]
    responses$task4_profile2_preselec[i] <- responses$`F-4-2-4`[i]
    responses$task4_profile3_preselec[i] <- responses$`F-4-3-4`[i]
  }
  if(responses$`F-4-4`[i]=="Recent state news"){
    responses$task4_profile1_recentnews[i] <- responses$`F-4-1-4`[i]
    responses$task4_profile2_recentnews[i] <- responses$`F-4-2-4`[i]
    responses$task4_profile3_recentnews[i] <- responses$`F-4-3-4`[i]
  }
  if(responses$`F-4-4`[i]=="Destination community type"){
    responses$task4_profile1_community[i] <- responses$`F-4-1-4`[i]
    responses$task4_profile2_community[i] <- responses$`F-4-2-4`[i]
    responses$task4_profile3_community[i] <- responses$`F-4-3-4`[i]
  }
  if(responses$`F-4-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task4_profile1_temp[i] <- responses$`F-4-1-5`[i]
    responses$task4_profile2_temp[i] <- responses$`F-4-2-5`[i]
    responses$task4_profile3_temp[i] <- responses$`F-4-3-5`[i]
  }
  if(responses$`F-4-5`[i]=="Most popular tourist attractions"){
    responses$task4_profile1_attractions[i] <- responses$`F-4-1-5`[i]
    responses$task4_profile2_attractions[i] <- responses$`F-4-2-5`[i]
    responses$task4_profile3_attractions[i] <- responses$`F-4-3-5`[i]
  }
  if(responses$`F-4-5`[i]=="Travel time from your home (by air)"){
    responses$task4_profile1_traveltime[i] <- responses$`F-4-1-5`[i]
    responses$task4_profile2_traveltime[i] <- responses$`F-4-2-5`[i]
    responses$task4_profile3_traveltime[i] <- responses$`F-4-3-5`[i]
  }
  if(responses$`F-4-5`[i]=="State-level 2020 presidential election result"){
    responses$task4_profile1_preselec[i] <- responses$`F-4-1-5`[i]
    responses$task4_profile2_preselec[i] <- responses$`F-4-2-5`[i]
    responses$task4_profile3_preselec[i] <- responses$`F-4-3-5`[i]
  }
  if(responses$`F-4-5`[i]=="Recent state news"){
    responses$task4_profile1_recentnews[i] <- responses$`F-4-1-5`[i]
    responses$task4_profile2_recentnews[i] <- responses$`F-4-2-5`[i]
    responses$task4_profile3_recentnews[i] <- responses$`F-4-3-5`[i]
  }
  if(responses$`F-4-5`[i]=="Destination community type"){
    responses$task4_profile1_community[i] <- responses$`F-4-1-5`[i]
    responses$task4_profile2_community[i] <- responses$`F-4-2-5`[i]
    responses$task4_profile3_community[i] <- responses$`F-4-3-5`[i]
  }
  if(responses$`F-4-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task4_profile1_temp[i] <- responses$`F-4-1-6`[i]
    responses$task4_profile2_temp[i] <- responses$`F-4-2-6`[i]
    responses$task4_profile3_temp[i] <- responses$`F-4-3-6`[i]
  }
  if(responses$`F-4-6`[i]=="Most popular tourist attractions"){
    responses$task4_profile1_attractions[i] <- responses$`F-4-1-6`[i]
    responses$task4_profile2_attractions[i] <- responses$`F-4-2-6`[i]
    responses$task4_profile3_attractions[i] <- responses$`F-4-3-6`[i]
  }
  if(responses$`F-4-6`[i]=="Travel time from your home (by air)"){
    responses$task4_profile1_traveltime[i] <- responses$`F-4-1-6`[i]
    responses$task4_profile2_traveltime[i] <- responses$`F-4-2-6`[i]
    responses$task4_profile3_traveltime[i] <- responses$`F-4-3-6`[i]
  }
  if(responses$`F-4-6`[i]=="State-level 2020 presidential election result"){
    responses$task4_profile1_preselec[i] <- responses$`F-4-1-6`[i]
    responses$task4_profile2_preselec[i] <- responses$`F-4-2-6`[i]
    responses$task4_profile3_preselec[i] <- responses$`F-4-3-6`[i]
  }
  if(responses$`F-4-6`[i]=="Recent state news"){
    responses$task4_profile1_recentnews[i] <- responses$`F-4-1-6`[i]
    responses$task4_profile2_recentnews[i] <- responses$`F-4-2-6`[i]
    responses$task4_profile3_recentnews[i] <- responses$`F-4-3-6`[i]
  }
  if(responses$`F-4-6`[i]=="Destination community type"){
    responses$task4_profile1_community[i] <- responses$`F-4-1-6`[i]
    responses$task4_profile2_community[i] <- responses$`F-4-2-6`[i]
    responses$task4_profile3_community[i] <- responses$`F-4-3-6`[i]
  }
  if(responses$`F-5-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task5_profile1_temp[i] <- responses$`F-5-1-1`[i]
    responses$task5_profile2_temp[i] <- responses$`F-5-2-1`[i]
    responses$task5_profile3_temp[i] <- responses$`F-5-3-1`[i]
  }
  if(responses$`F-5-1`[i]=="Most popular tourist attractions"){
    responses$task5_profile1_attractions[i] <- responses$`F-5-1-1`[i]
    responses$task5_profile2_attractions[i] <- responses$`F-5-2-1`[i]
    responses$task5_profile3_attractions[i] <- responses$`F-5-3-1`[i]
  }
  if(responses$`F-5-1`[i]=="Travel time from your home (by air)"){
    responses$task5_profile1_traveltime[i] <- responses$`F-5-1-1`[i]
    responses$task5_profile2_traveltime[i] <- responses$`F-5-2-1`[i]
    responses$task5_profile3_traveltime[i] <- responses$`F-5-3-1`[i]
  }
  if(responses$`F-5-1`[i]=="State-level 2020 presidential election result"){
    responses$task5_profile1_preselec[i] <- responses$`F-5-1-1`[i]
    responses$task5_profile2_preselec[i] <- responses$`F-5-2-1`[i]
    responses$task5_profile3_preselec[i] <- responses$`F-5-3-1`[i]
  }
  if(responses$`F-5-1`[i]=="Recent state news"){
    responses$task5_profile1_recentnews[i] <- responses$`F-5-1-1`[i]
    responses$task5_profile2_recentnews[i] <- responses$`F-5-2-1`[i]
    responses$task5_profile3_recentnews[i] <- responses$`F-5-3-1`[i]
  }
  if(responses$`F-5-1`[i]=="Destination community type"){
    responses$task5_profile1_community[i] <- responses$`F-5-1-1`[i]
    responses$task5_profile2_community[i] <- responses$`F-5-2-1`[i]
    responses$task5_profile3_community[i] <- responses$`F-5-3-1`[i]
  }
  if(responses$`F-5-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task5_profile1_temp[i] <- responses$`F-5-1-2`[i]
    responses$task5_profile2_temp[i] <- responses$`F-5-2-2`[i]
    responses$task5_profile3_temp[i] <- responses$`F-5-3-2`[i]
  }
  if(responses$`F-5-2`[i]=="Most popular tourist attractions"){
    responses$task5_profile1_attractions[i] <- responses$`F-5-1-2`[i]
    responses$task5_profile2_attractions[i] <- responses$`F-5-2-2`[i]
    responses$task5_profile3_attractions[i] <- responses$`F-5-3-2`[i]
  }
  if(responses$`F-5-2`[i]=="Travel time from your home (by air)"){
    responses$task5_profile1_traveltime[i] <- responses$`F-5-1-2`[i]
    responses$task5_profile2_traveltime[i] <- responses$`F-5-2-2`[i]
    responses$task5_profile3_traveltime[i] <- responses$`F-5-3-2`[i]
  }
  if(responses$`F-5-2`[i]=="State-level 2020 presidential election result"){
    responses$task5_profile1_preselec[i] <- responses$`F-5-1-2`[i]
    responses$task5_profile2_preselec[i] <- responses$`F-5-2-2`[i]
    responses$task5_profile3_preselec[i] <- responses$`F-5-3-2`[i]
  }
  if(responses$`F-5-2`[i]=="Recent state news"){
    responses$task5_profile1_recentnews[i] <- responses$`F-5-1-2`[i]
    responses$task5_profile2_recentnews[i] <- responses$`F-5-2-2`[i]
    responses$task5_profile3_recentnews[i] <- responses$`F-5-3-2`[i]
  }
  if(responses$`F-5-2`[i]=="Destination community type"){
    responses$task5_profile1_community[i] <- responses$`F-5-1-2`[i]
    responses$task5_profile2_community[i] <- responses$`F-5-2-2`[i]
    responses$task5_profile3_community[i] <- responses$`F-5-3-2`[i]
  }
  if(responses$`F-5-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task5_profile1_temp[i] <- responses$`F-5-1-3`[i]
    responses$task5_profile2_temp[i] <- responses$`F-5-2-3`[i]
    responses$task5_profile3_temp[i] <- responses$`F-5-3-3`[i]
  }
  if(responses$`F-5-3`[i]=="Most popular tourist attractions"){
    responses$task5_profile1_attractions[i] <- responses$`F-5-1-3`[i]
    responses$task5_profile2_attractions[i] <- responses$`F-5-2-3`[i]
    responses$task5_profile3_attractions[i] <- responses$`F-5-3-3`[i]
  }
  if(responses$`F-5-3`[i]=="Travel time from your home (by air)"){
    responses$task5_profile1_traveltime[i] <- responses$`F-5-1-3`[i]
    responses$task5_profile2_traveltime[i] <- responses$`F-5-2-3`[i]
    responses$task5_profile3_traveltime[i] <- responses$`F-5-3-3`[i]
  }
  if(responses$`F-5-3`[i]=="State-level 2020 presidential election result"){
    responses$task5_profile1_preselec[i] <- responses$`F-5-1-3`[i]
    responses$task5_profile2_preselec[i] <- responses$`F-5-2-3`[i]
    responses$task5_profile3_preselec[i] <- responses$`F-5-3-3`[i]
  }
  if(responses$`F-5-3`[i]=="Recent state news"){
    responses$task5_profile1_recentnews[i] <- responses$`F-5-1-3`[i]
    responses$task5_profile2_recentnews[i] <- responses$`F-5-2-3`[i]
    responses$task5_profile3_recentnews[i] <- responses$`F-5-3-3`[i]
  }
  if(responses$`F-5-3`[i]=="Destination community type"){
    responses$task5_profile1_community[i] <- responses$`F-5-1-3`[i]
    responses$task5_profile2_community[i] <- responses$`F-5-2-3`[i]
    responses$task5_profile3_community[i] <- responses$`F-5-3-3`[i]
  }
  if(responses$`F-5-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task5_profile1_temp[i] <- responses$`F-5-1-4`[i]
    responses$task5_profile2_temp[i] <- responses$`F-5-2-4`[i]
    responses$task5_profile3_temp[i] <- responses$`F-5-3-4`[i]
  }
  if(responses$`F-5-4`[i]=="Most popular tourist attractions"){
    responses$task5_profile1_attractions[i] <- responses$`F-5-1-4`[i]
    responses$task5_profile2_attractions[i] <- responses$`F-5-2-4`[i]
    responses$task5_profile3_attractions[i] <- responses$`F-5-3-4`[i]
  }
  if(responses$`F-5-4`[i]=="Travel time from your home (by air)"){
    responses$task5_profile1_traveltime[i] <- responses$`F-5-1-4`[i]
    responses$task5_profile2_traveltime[i] <- responses$`F-5-2-4`[i]
    responses$task5_profile3_traveltime[i] <- responses$`F-5-3-4`[i]
  }
  if(responses$`F-5-4`[i]=="State-level 2020 presidential election result"){
    responses$task5_profile1_preselec[i] <- responses$`F-5-1-4`[i]
    responses$task5_profile2_preselec[i] <- responses$`F-5-2-4`[i]
    responses$task5_profile3_preselec[i] <- responses$`F-5-3-4`[i]
  }
  if(responses$`F-5-4`[i]=="Recent state news"){
    responses$task5_profile1_recentnews[i] <- responses$`F-5-1-4`[i]
    responses$task5_profile2_recentnews[i] <- responses$`F-5-2-4`[i]
    responses$task5_profile3_recentnews[i] <- responses$`F-5-3-4`[i]
  }
  if(responses$`F-5-4`[i]=="Destination community type"){
    responses$task5_profile1_community[i] <- responses$`F-5-1-4`[i]
    responses$task5_profile2_community[i] <- responses$`F-5-2-4`[i]
    responses$task5_profile3_community[i] <- responses$`F-5-3-4`[i]
  }
  if(responses$`F-5-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task5_profile1_temp[i] <- responses$`F-5-1-5`[i]
    responses$task5_profile2_temp[i] <- responses$`F-5-2-5`[i]
    responses$task5_profile3_temp[i] <- responses$`F-5-3-5`[i]
  }
  if(responses$`F-5-5`[i]=="Most popular tourist attractions"){
    responses$task5_profile1_attractions[i] <- responses$`F-5-1-5`[i]
    responses$task5_profile2_attractions[i] <- responses$`F-5-2-5`[i]
    responses$task5_profile3_attractions[i] <- responses$`F-5-3-5`[i]
  }
  if(responses$`F-5-5`[i]=="Travel time from your home (by air)"){
    responses$task5_profile1_traveltime[i] <- responses$`F-5-1-5`[i]
    responses$task5_profile2_traveltime[i] <- responses$`F-5-2-5`[i]
    responses$task5_profile3_traveltime[i] <- responses$`F-5-3-5`[i]
  }
  if(responses$`F-5-5`[i]=="State-level 2020 presidential election result"){
    responses$task5_profile1_preselec[i] <- responses$`F-5-1-5`[i]
    responses$task5_profile2_preselec[i] <- responses$`F-5-2-5`[i]
    responses$task5_profile3_preselec[i] <- responses$`F-5-3-5`[i]
  }
  if(responses$`F-5-5`[i]=="Recent state news"){
    responses$task5_profile1_recentnews[i] <- responses$`F-5-1-5`[i]
    responses$task5_profile2_recentnews[i] <- responses$`F-5-2-5`[i]
    responses$task5_profile3_recentnews[i] <- responses$`F-5-3-5`[i]
  }
  if(responses$`F-5-5`[i]=="Destination community type"){
    responses$task5_profile1_community[i] <- responses$`F-5-1-5`[i]
    responses$task5_profile2_community[i] <- responses$`F-5-2-5`[i]
    responses$task5_profile3_community[i] <- responses$`F-5-3-5`[i]
  }
  if(responses$`F-5-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task5_profile1_temp[i] <- responses$`F-5-1-6`[i]
    responses$task5_profile2_temp[i] <- responses$`F-5-2-6`[i]
    responses$task5_profile3_temp[i] <- responses$`F-5-3-6`[i]
  }
  if(responses$`F-5-6`[i]=="Most popular tourist attractions"){
    responses$task5_profile1_attractions[i] <- responses$`F-5-1-6`[i]
    responses$task5_profile2_attractions[i] <- responses$`F-5-2-6`[i]
    responses$task5_profile3_attractions[i] <- responses$`F-5-3-6`[i]
  }
  if(responses$`F-5-6`[i]=="Travel time from your home (by air)"){
    responses$task5_profile1_traveltime[i] <- responses$`F-5-1-6`[i]
    responses$task5_profile2_traveltime[i] <- responses$`F-5-2-6`[i]
    responses$task5_profile3_traveltime[i] <- responses$`F-5-3-6`[i]
  }
  if(responses$`F-5-6`[i]=="State-level 2020 presidential election result"){
    responses$task5_profile1_preselec[i] <- responses$`F-5-1-6`[i]
    responses$task5_profile2_preselec[i] <- responses$`F-5-2-6`[i]
    responses$task5_profile3_preselec[i] <- responses$`F-5-3-6`[i]
  }
  if(responses$`F-5-6`[i]=="Recent state news"){
    responses$task5_profile1_recentnews[i] <- responses$`F-5-1-6`[i]
    responses$task5_profile2_recentnews[i] <- responses$`F-5-2-6`[i]
    responses$task5_profile3_recentnews[i] <- responses$`F-5-3-6`[i]
  }
  if(responses$`F-5-6`[i]=="Destination community type"){
    responses$task5_profile1_community[i] <- responses$`F-5-1-6`[i]
    responses$task5_profile2_community[i] <- responses$`F-5-2-6`[i]
    responses$task5_profile3_community[i] <- responses$`F-5-3-6`[i]
  }
  if(responses$`F-6-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task6_profile1_temp[i] <- responses$`F-6-1-1`[i]
    responses$task6_profile2_temp[i] <- responses$`F-6-2-1`[i]
    responses$task6_profile3_temp[i] <- responses$`F-6-3-1`[i]
  }
  if(responses$`F-6-1`[i]=="Most popular tourist attractions"){
    responses$task6_profile1_attractions[i] <- responses$`F-6-1-1`[i]
    responses$task6_profile2_attractions[i] <- responses$`F-6-2-1`[i]
    responses$task6_profile3_attractions[i] <- responses$`F-6-3-1`[i]
  }
  if(responses$`F-6-1`[i]=="Travel time from your home (by air)"){
    responses$task6_profile1_traveltime[i] <- responses$`F-6-1-1`[i]
    responses$task6_profile2_traveltime[i] <- responses$`F-6-2-1`[i]
    responses$task6_profile3_traveltime[i] <- responses$`F-6-3-1`[i]
  }
  if(responses$`F-6-1`[i]=="State-level 2020 presidential election result"){
    responses$task6_profile1_preselec[i] <- responses$`F-6-1-1`[i]
    responses$task6_profile2_preselec[i] <- responses$`F-6-2-1`[i]
    responses$task6_profile3_preselec[i] <- responses$`F-6-3-1`[i]
  }
  if(responses$`F-6-1`[i]=="Recent state news"){
    responses$task6_profile1_recentnews[i] <- responses$`F-6-1-1`[i]
    responses$task6_profile2_recentnews[i] <- responses$`F-6-2-1`[i]
    responses$task6_profile3_recentnews[i] <- responses$`F-6-3-1`[i]
  }
  if(responses$`F-6-1`[i]=="Destination community type"){
    responses$task6_profile1_community[i] <- responses$`F-6-1-1`[i]
    responses$task6_profile2_community[i] <- responses$`F-6-2-1`[i]
    responses$task6_profile3_community[i] <- responses$`F-6-3-1`[i]
  }
  if(responses$`F-6-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task6_profile1_temp[i] <- responses$`F-6-1-2`[i]
    responses$task6_profile2_temp[i] <- responses$`F-6-2-2`[i]
    responses$task6_profile3_temp[i] <- responses$`F-6-3-2`[i]
  }
  if(responses$`F-6-2`[i]=="Most popular tourist attractions"){
    responses$task6_profile1_attractions[i] <- responses$`F-6-1-2`[i]
    responses$task6_profile2_attractions[i] <- responses$`F-6-2-2`[i]
    responses$task6_profile3_attractions[i] <- responses$`F-6-3-2`[i]
  }
  if(responses$`F-6-2`[i]=="Travel time from your home (by air)"){
    responses$task6_profile1_traveltime[i] <- responses$`F-6-1-2`[i]
    responses$task6_profile2_traveltime[i] <- responses$`F-6-2-2`[i]
    responses$task6_profile3_traveltime[i] <- responses$`F-6-3-2`[i]
  }
  if(responses$`F-6-2`[i]=="State-level 2020 presidential election result"){
    responses$task6_profile1_preselec[i] <- responses$`F-6-1-2`[i]
    responses$task6_profile2_preselec[i] <- responses$`F-6-2-2`[i]
    responses$task6_profile3_preselec[i] <- responses$`F-6-3-2`[i]
  }
  if(responses$`F-6-2`[i]=="Recent state news"){
    responses$task6_profile1_recentnews[i] <- responses$`F-6-1-2`[i]
    responses$task6_profile2_recentnews[i] <- responses$`F-6-2-2`[i]
    responses$task6_profile3_recentnews[i] <- responses$`F-6-3-2`[i]
  }
  if(responses$`F-6-2`[i]=="Destination community type"){
    responses$task6_profile1_community[i] <- responses$`F-6-1-2`[i]
    responses$task6_profile2_community[i] <- responses$`F-6-2-2`[i]
    responses$task6_profile3_community[i] <- responses$`F-6-3-2`[i]
  }
  if(responses$`F-6-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task6_profile1_temp[i] <- responses$`F-6-1-3`[i]
    responses$task6_profile2_temp[i] <- responses$`F-6-2-3`[i]
    responses$task6_profile3_temp[i] <- responses$`F-6-3-3`[i]
  }
  if(responses$`F-6-3`[i]=="Most popular tourist attractions"){
    responses$task6_profile1_attractions[i] <- responses$`F-6-1-3`[i]
    responses$task6_profile2_attractions[i] <- responses$`F-6-2-3`[i]
    responses$task6_profile3_attractions[i] <- responses$`F-6-3-3`[i]
  }
  if(responses$`F-6-3`[i]=="Travel time from your home (by air)"){
    responses$task6_profile1_traveltime[i] <- responses$`F-6-1-3`[i]
    responses$task6_profile2_traveltime[i] <- responses$`F-6-2-3`[i]
    responses$task6_profile3_traveltime[i] <- responses$`F-6-3-3`[i]
  }
  if(responses$`F-6-3`[i]=="State-level 2020 presidential election result"){
    responses$task6_profile1_preselec[i] <- responses$`F-6-1-3`[i]
    responses$task6_profile2_preselec[i] <- responses$`F-6-2-3`[i]
    responses$task6_profile3_preselec[i] <- responses$`F-6-3-3`[i]
  }
  if(responses$`F-6-3`[i]=="Recent state news"){
    responses$task6_profile1_recentnews[i] <- responses$`F-6-1-3`[i]
    responses$task6_profile2_recentnews[i] <- responses$`F-6-2-3`[i]
    responses$task6_profile3_recentnews[i] <- responses$`F-6-3-3`[i]
  }
  if(responses$`F-6-3`[i]=="Destination community type"){
    responses$task6_profile1_community[i] <- responses$`F-6-1-3`[i]
    responses$task6_profile2_community[i] <- responses$`F-6-2-3`[i]
    responses$task6_profile3_community[i] <- responses$`F-6-3-3`[i]
  }
  if(responses$`F-6-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task6_profile1_temp[i] <- responses$`F-6-1-4`[i]
    responses$task6_profile2_temp[i] <- responses$`F-6-2-4`[i]
    responses$task6_profile3_temp[i] <- responses$`F-6-3-4`[i]
  }
  if(responses$`F-6-4`[i]=="Most popular tourist attractions"){
    responses$task6_profile1_attractions[i] <- responses$`F-6-1-4`[i]
    responses$task6_profile2_attractions[i] <- responses$`F-6-2-4`[i]
    responses$task6_profile3_attractions[i] <- responses$`F-6-3-4`[i]
  }
  if(responses$`F-6-4`[i]=="Travel time from your home (by air)"){
    responses$task6_profile1_traveltime[i] <- responses$`F-6-1-4`[i]
    responses$task6_profile2_traveltime[i] <- responses$`F-6-2-4`[i]
    responses$task6_profile3_traveltime[i] <- responses$`F-6-3-4`[i]
  }
  if(responses$`F-6-4`[i]=="State-level 2020 presidential election result"){
    responses$task6_profile1_preselec[i] <- responses$`F-6-1-4`[i]
    responses$task6_profile2_preselec[i] <- responses$`F-6-2-4`[i]
    responses$task6_profile3_preselec[i] <- responses$`F-6-3-4`[i]
  }
  if(responses$`F-6-4`[i]=="Recent state news"){
    responses$task6_profile1_recentnews[i] <- responses$`F-6-1-4`[i]
    responses$task6_profile2_recentnews[i] <- responses$`F-6-2-4`[i]
    responses$task6_profile3_recentnews[i] <- responses$`F-6-3-4`[i]
  }
  if(responses$`F-6-4`[i]=="Destination community type"){
    responses$task6_profile1_community[i] <- responses$`F-6-1-4`[i]
    responses$task6_profile2_community[i] <- responses$`F-6-2-4`[i]
    responses$task6_profile3_community[i] <- responses$`F-6-3-4`[i]
  }
  if(responses$`F-6-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task6_profile1_temp[i] <- responses$`F-6-1-5`[i]
    responses$task6_profile2_temp[i] <- responses$`F-6-2-5`[i]
    responses$task6_profile3_temp[i] <- responses$`F-6-3-5`[i]
  }
  if(responses$`F-6-5`[i]=="Most popular tourist attractions"){
    responses$task6_profile1_attractions[i] <- responses$`F-6-1-5`[i]
    responses$task6_profile2_attractions[i] <- responses$`F-6-2-5`[i]
    responses$task6_profile3_attractions[i] <- responses$`F-6-3-5`[i]
  }
  if(responses$`F-6-5`[i]=="Travel time from your home (by air)"){
    responses$task6_profile1_traveltime[i] <- responses$`F-6-1-5`[i]
    responses$task6_profile2_traveltime[i] <- responses$`F-6-2-5`[i]
    responses$task6_profile3_traveltime[i] <- responses$`F-6-3-5`[i]
  }
  if(responses$`F-6-5`[i]=="State-level 2020 presidential election result"){
    responses$task6_profile1_preselec[i] <- responses$`F-6-1-5`[i]
    responses$task6_profile2_preselec[i] <- responses$`F-6-2-5`[i]
    responses$task6_profile3_preselec[i] <- responses$`F-6-3-5`[i]
  }
  if(responses$`F-6-5`[i]=="Recent state news"){
    responses$task6_profile1_recentnews[i] <- responses$`F-6-1-5`[i]
    responses$task6_profile2_recentnews[i] <- responses$`F-6-2-5`[i]
    responses$task6_profile3_recentnews[i] <- responses$`F-6-3-5`[i]
  }
  if(responses$`F-6-5`[i]=="Destination community type"){
    responses$task6_profile1_community[i] <- responses$`F-6-1-5`[i]
    responses$task6_profile2_community[i] <- responses$`F-6-2-5`[i]
    responses$task6_profile3_community[i] <- responses$`F-6-3-5`[i]
  }
  if(responses$`F-6-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task6_profile1_temp[i] <- responses$`F-6-1-6`[i]
    responses$task6_profile2_temp[i] <- responses$`F-6-2-6`[i]
    responses$task6_profile3_temp[i] <- responses$`F-6-3-6`[i]
  }
  if(responses$`F-6-6`[i]=="Most popular tourist attractions"){
    responses$task6_profile1_attractions[i] <- responses$`F-6-1-6`[i]
    responses$task6_profile2_attractions[i] <- responses$`F-6-2-6`[i]
    responses$task6_profile3_attractions[i] <- responses$`F-6-3-6`[i]
  }
  if(responses$`F-6-6`[i]=="Travel time from your home (by air)"){
    responses$task6_profile1_traveltime[i] <- responses$`F-6-1-6`[i]
    responses$task6_profile2_traveltime[i] <- responses$`F-6-2-6`[i]
    responses$task6_profile3_traveltime[i] <- responses$`F-6-3-6`[i]
  }
  if(responses$`F-6-6`[i]=="State-level 2020 presidential election result"){
    responses$task6_profile1_preselec[i] <- responses$`F-6-1-6`[i]
    responses$task6_profile2_preselec[i] <- responses$`F-6-2-6`[i]
    responses$task6_profile3_preselec[i] <- responses$`F-6-3-6`[i]
  }
  if(responses$`F-6-6`[i]=="Recent state news"){
    responses$task6_profile1_recentnews[i] <- responses$`F-6-1-6`[i]
    responses$task6_profile2_recentnews[i] <- responses$`F-6-2-6`[i]
    responses$task6_profile3_recentnews[i] <- responses$`F-6-3-6`[i]
  }
  if(responses$`F-6-6`[i]=="Destination community type"){
    responses$task6_profile1_community[i] <- responses$`F-6-1-6`[i]
    responses$task6_profile2_community[i] <- responses$`F-6-2-6`[i]
    responses$task6_profile3_community[i] <- responses$`F-6-3-6`[i]
  }
  if(responses$`F-7-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task7_profile1_temp[i] <- responses$`F-7-1-1`[i]
    responses$task7_profile2_temp[i] <- responses$`F-7-2-1`[i]
    responses$task7_profile3_temp[i] <- responses$`F-7-3-1`[i]
  }
  if(responses$`F-7-1`[i]=="Most popular tourist attractions"){
    responses$task7_profile1_attractions[i] <- responses$`F-7-1-1`[i]
    responses$task7_profile2_attractions[i] <- responses$`F-7-2-1`[i]
    responses$task7_profile3_attractions[i] <- responses$`F-7-3-1`[i]
  }
  if(responses$`F-7-1`[i]=="Travel time from your home (by air)"){
    responses$task7_profile1_traveltime[i] <- responses$`F-7-1-1`[i]
    responses$task7_profile2_traveltime[i] <- responses$`F-7-2-1`[i]
    responses$task7_profile3_traveltime[i] <- responses$`F-7-3-1`[i]
  }
  if(responses$`F-7-1`[i]=="State-level 2020 presidential election result"){
    responses$task7_profile1_preselec[i] <- responses$`F-7-1-1`[i]
    responses$task7_profile2_preselec[i] <- responses$`F-7-2-1`[i]
    responses$task7_profile3_preselec[i] <- responses$`F-7-3-1`[i]
  }
  if(responses$`F-7-1`[i]=="Recent state news"){
    responses$task7_profile1_recentnews[i] <- responses$`F-7-1-1`[i]
    responses$task7_profile2_recentnews[i] <- responses$`F-7-2-1`[i]
    responses$task7_profile3_recentnews[i] <- responses$`F-7-3-1`[i]
  }
  if(responses$`F-7-1`[i]=="Destination community type"){
    responses$task7_profile1_community[i] <- responses$`F-7-1-1`[i]
    responses$task7_profile2_community[i] <- responses$`F-7-2-1`[i]
    responses$task7_profile3_community[i] <- responses$`F-7-3-1`[i]
  }
  if(responses$`F-7-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task7_profile1_temp[i] <- responses$`F-7-1-2`[i]
    responses$task7_profile2_temp[i] <- responses$`F-7-2-2`[i]
    responses$task7_profile3_temp[i] <- responses$`F-7-3-2`[i]
  }
  if(responses$`F-7-2`[i]=="Most popular tourist attractions"){
    responses$task7_profile1_attractions[i] <- responses$`F-7-1-2`[i]
    responses$task7_profile2_attractions[i] <- responses$`F-7-2-2`[i]
    responses$task7_profile3_attractions[i] <- responses$`F-7-3-2`[i]
  }
  if(responses$`F-7-2`[i]=="Travel time from your home (by air)"){
    responses$task7_profile1_traveltime[i] <- responses$`F-7-1-2`[i]
    responses$task7_profile2_traveltime[i] <- responses$`F-7-2-2`[i]
    responses$task7_profile3_traveltime[i] <- responses$`F-7-3-2`[i]
  }
  if(responses$`F-7-2`[i]=="State-level 2020 presidential election result"){
    responses$task7_profile1_preselec[i] <- responses$`F-7-1-2`[i]
    responses$task7_profile2_preselec[i] <- responses$`F-7-2-2`[i]
    responses$task7_profile3_preselec[i] <- responses$`F-7-3-2`[i]
  }
  if(responses$`F-7-2`[i]=="Recent state news"){
    responses$task7_profile1_recentnews[i] <- responses$`F-7-1-2`[i]
    responses$task7_profile2_recentnews[i] <- responses$`F-7-2-2`[i]
    responses$task7_profile3_recentnews[i] <- responses$`F-7-3-2`[i]
  }
  if(responses$`F-7-2`[i]=="Destination community type"){
    responses$task7_profile1_community[i] <- responses$`F-7-1-2`[i]
    responses$task7_profile2_community[i] <- responses$`F-7-2-2`[i]
    responses$task7_profile3_community[i] <- responses$`F-7-3-2`[i]
  }
  if(responses$`F-7-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task7_profile1_temp[i] <- responses$`F-7-1-3`[i]
    responses$task7_profile2_temp[i] <- responses$`F-7-2-3`[i]
    responses$task7_profile3_temp[i] <- responses$`F-7-3-3`[i]
  }
  if(responses$`F-7-3`[i]=="Most popular tourist attractions"){
    responses$task7_profile1_attractions[i] <- responses$`F-7-1-3`[i]
    responses$task7_profile2_attractions[i] <- responses$`F-7-2-3`[i]
    responses$task7_profile3_attractions[i] <- responses$`F-7-3-3`[i]
  }
  if(responses$`F-7-3`[i]=="Travel time from your home (by air)"){
    responses$task7_profile1_traveltime[i] <- responses$`F-7-1-3`[i]
    responses$task7_profile2_traveltime[i] <- responses$`F-7-2-3`[i]
    responses$task7_profile3_traveltime[i] <- responses$`F-7-3-3`[i]
  }
  if(responses$`F-7-3`[i]=="State-level 2020 presidential election result"){
    responses$task7_profile1_preselec[i] <- responses$`F-7-1-3`[i]
    responses$task7_profile2_preselec[i] <- responses$`F-7-2-3`[i]
    responses$task7_profile3_preselec[i] <- responses$`F-7-3-3`[i]
  }
  if(responses$`F-7-3`[i]=="Recent state news"){
    responses$task7_profile1_recentnews[i] <- responses$`F-7-1-3`[i]
    responses$task7_profile2_recentnews[i] <- responses$`F-7-2-3`[i]
    responses$task7_profile3_recentnews[i] <- responses$`F-7-3-3`[i]
  }
  if(responses$`F-7-3`[i]=="Destination community type"){
    responses$task7_profile1_community[i] <- responses$`F-7-1-3`[i]
    responses$task7_profile2_community[i] <- responses$`F-7-2-3`[i]
    responses$task7_profile3_community[i] <- responses$`F-7-3-3`[i]
  }
  if(responses$`F-7-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task7_profile1_temp[i] <- responses$`F-7-1-4`[i]
    responses$task7_profile2_temp[i] <- responses$`F-7-2-4`[i]
    responses$task7_profile3_temp[i] <- responses$`F-7-3-4`[i]
  }
  if(responses$`F-7-4`[i]=="Most popular tourist attractions"){
    responses$task7_profile1_attractions[i] <- responses$`F-7-1-4`[i]
    responses$task7_profile2_attractions[i] <- responses$`F-7-2-4`[i]
    responses$task7_profile3_attractions[i] <- responses$`F-7-3-4`[i]
  }
  if(responses$`F-7-4`[i]=="Travel time from your home (by air)"){
    responses$task7_profile1_traveltime[i] <- responses$`F-7-1-4`[i]
    responses$task7_profile2_traveltime[i] <- responses$`F-7-2-4`[i]
    responses$task7_profile3_traveltime[i] <- responses$`F-7-3-4`[i]
  }
  if(responses$`F-7-4`[i]=="State-level 2020 presidential election result"){
    responses$task7_profile1_preselec[i] <- responses$`F-7-1-4`[i]
    responses$task7_profile2_preselec[i] <- responses$`F-7-2-4`[i]
    responses$task7_profile3_preselec[i] <- responses$`F-7-3-4`[i]
  }
  if(responses$`F-7-4`[i]=="Recent state news"){
    responses$task7_profile1_recentnews[i] <- responses$`F-7-1-4`[i]
    responses$task7_profile2_recentnews[i] <- responses$`F-7-2-4`[i]
    responses$task7_profile3_recentnews[i] <- responses$`F-7-3-4`[i]
  }
  if(responses$`F-7-4`[i]=="Destination community type"){
    responses$task7_profile1_community[i] <- responses$`F-7-1-4`[i]
    responses$task7_profile2_community[i] <- responses$`F-7-2-4`[i]
    responses$task7_profile3_community[i] <- responses$`F-7-3-4`[i]
  }
  if(responses$`F-7-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task7_profile1_temp[i] <- responses$`F-7-1-5`[i]
    responses$task7_profile2_temp[i] <- responses$`F-7-2-5`[i]
    responses$task7_profile3_temp[i] <- responses$`F-7-3-5`[i]
  }
  if(responses$`F-7-5`[i]=="Most popular tourist attractions"){
    responses$task7_profile1_attractions[i] <- responses$`F-7-1-5`[i]
    responses$task7_profile2_attractions[i] <- responses$`F-7-2-5`[i]
    responses$task7_profile3_attractions[i] <- responses$`F-7-3-5`[i]
  }
  if(responses$`F-7-5`[i]=="Travel time from your home (by air)"){
    responses$task7_profile1_traveltime[i] <- responses$`F-7-1-5`[i]
    responses$task7_profile2_traveltime[i] <- responses$`F-7-2-5`[i]
    responses$task7_profile3_traveltime[i] <- responses$`F-7-3-5`[i]
  }
  if(responses$`F-7-5`[i]=="State-level 2020 presidential election result"){
    responses$task7_profile1_preselec[i] <- responses$`F-7-1-5`[i]
    responses$task7_profile2_preselec[i] <- responses$`F-7-2-5`[i]
    responses$task7_profile3_preselec[i] <- responses$`F-7-3-5`[i]
  }
  if(responses$`F-7-5`[i]=="Recent state news"){
    responses$task7_profile1_recentnews[i] <- responses$`F-7-1-5`[i]
    responses$task7_profile2_recentnews[i] <- responses$`F-7-2-5`[i]
    responses$task7_profile3_recentnews[i] <- responses$`F-7-3-5`[i]
  }
  if(responses$`F-7-5`[i]=="Destination community type"){
    responses$task7_profile1_community[i] <- responses$`F-7-1-5`[i]
    responses$task7_profile2_community[i] <- responses$`F-7-2-5`[i]
    responses$task7_profile3_community[i] <- responses$`F-7-3-5`[i]
  }
  if(responses$`F-7-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task7_profile1_temp[i] <- responses$`F-7-1-6`[i]
    responses$task7_profile2_temp[i] <- responses$`F-7-2-6`[i]
    responses$task7_profile3_temp[i] <- responses$`F-7-3-6`[i]
  }
  if(responses$`F-7-6`[i]=="Most popular tourist attractions"){
    responses$task7_profile1_attractions[i] <- responses$`F-7-1-6`[i]
    responses$task7_profile2_attractions[i] <- responses$`F-7-2-6`[i]
    responses$task7_profile3_attractions[i] <- responses$`F-7-3-6`[i]
  }
  if(responses$`F-7-6`[i]=="Travel time from your home (by air)"){
    responses$task7_profile1_traveltime[i] <- responses$`F-7-1-6`[i]
    responses$task7_profile2_traveltime[i] <- responses$`F-7-2-6`[i]
    responses$task7_profile3_traveltime[i] <- responses$`F-7-3-6`[i]
  }
  if(responses$`F-7-6`[i]=="State-level 2020 presidential election result"){
    responses$task7_profile1_preselec[i] <- responses$`F-7-1-6`[i]
    responses$task7_profile2_preselec[i] <- responses$`F-7-2-6`[i]
    responses$task7_profile3_preselec[i] <- responses$`F-7-3-6`[i]
  }
  if(responses$`F-7-6`[i]=="Recent state news"){
    responses$task7_profile1_recentnews[i] <- responses$`F-7-1-6`[i]
    responses$task7_profile2_recentnews[i] <- responses$`F-7-2-6`[i]
    responses$task7_profile3_recentnews[i] <- responses$`F-7-3-6`[i]
  }
  if(responses$`F-7-6`[i]=="Destination community type"){
    responses$task7_profile1_community[i] <- responses$`F-7-1-6`[i]
    responses$task7_profile2_community[i] <- responses$`F-7-2-6`[i]
    responses$task7_profile3_community[i] <- responses$`F-7-3-6`[i]
  }
  if(responses$`F-8-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task8_profile1_temp[i] <- responses$`F-8-1-1`[i]
    responses$task8_profile2_temp[i] <- responses$`F-8-2-1`[i]
    responses$task8_profile3_temp[i] <- responses$`F-8-3-1`[i]
  }
  if(responses$`F-8-1`[i]=="Most popular tourist attractions"){
    responses$task8_profile1_attractions[i] <- responses$`F-8-1-1`[i]
    responses$task8_profile2_attractions[i] <- responses$`F-8-2-1`[i]
    responses$task8_profile3_attractions[i] <- responses$`F-8-3-1`[i]
  }
  if(responses$`F-8-1`[i]=="Travel time from your home (by air)"){
    responses$task8_profile1_traveltime[i] <- responses$`F-8-1-1`[i]
    responses$task8_profile2_traveltime[i] <- responses$`F-8-2-1`[i]
    responses$task8_profile3_traveltime[i] <- responses$`F-8-3-1`[i]
  }
  if(responses$`F-8-1`[i]=="State-level 2020 presidential election result"){
    responses$task8_profile1_preselec[i] <- responses$`F-8-1-1`[i]
    responses$task8_profile2_preselec[i] <- responses$`F-8-2-1`[i]
    responses$task8_profile3_preselec[i] <- responses$`F-8-3-1`[i]
  }
  if(responses$`F-8-1`[i]=="Recent state news"){
    responses$task8_profile1_recentnews[i] <- responses$`F-8-1-1`[i]
    responses$task8_profile2_recentnews[i] <- responses$`F-8-2-1`[i]
    responses$task8_profile3_recentnews[i] <- responses$`F-8-3-1`[i]
  }
  if(responses$`F-8-1`[i]=="Destination community type"){
    responses$task8_profile1_community[i] <- responses$`F-8-1-1`[i]
    responses$task8_profile2_community[i] <- responses$`F-8-2-1`[i]
    responses$task8_profile3_community[i] <- responses$`F-8-3-1`[i]
  }
  if(responses$`F-8-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task8_profile1_temp[i] <- responses$`F-8-1-2`[i]
    responses$task8_profile2_temp[i] <- responses$`F-8-2-2`[i]
    responses$task8_profile3_temp[i] <- responses$`F-8-3-2`[i]
  }
  if(responses$`F-8-2`[i]=="Most popular tourist attractions"){
    responses$task8_profile1_attractions[i] <- responses$`F-8-1-2`[i]
    responses$task8_profile2_attractions[i] <- responses$`F-8-2-2`[i]
    responses$task8_profile3_attractions[i] <- responses$`F-8-3-2`[i]
  }
  if(responses$`F-8-2`[i]=="Travel time from your home (by air)"){
    responses$task8_profile1_traveltime[i] <- responses$`F-8-1-2`[i]
    responses$task8_profile2_traveltime[i] <- responses$`F-8-2-2`[i]
    responses$task8_profile3_traveltime[i] <- responses$`F-8-3-2`[i]
  }
  if(responses$`F-8-2`[i]=="State-level 2020 presidential election result"){
    responses$task8_profile1_preselec[i] <- responses$`F-8-1-2`[i]
    responses$task8_profile2_preselec[i] <- responses$`F-8-2-2`[i]
    responses$task8_profile3_preselec[i] <- responses$`F-8-3-2`[i]
  }
  if(responses$`F-8-2`[i]=="Recent state news"){
    responses$task8_profile1_recentnews[i] <- responses$`F-8-1-2`[i]
    responses$task8_profile2_recentnews[i] <- responses$`F-8-2-2`[i]
    responses$task8_profile3_recentnews[i] <- responses$`F-8-3-2`[i]
  }
  if(responses$`F-8-2`[i]=="Destination community type"){
    responses$task8_profile1_community[i] <- responses$`F-8-1-2`[i]
    responses$task8_profile2_community[i] <- responses$`F-8-2-2`[i]
    responses$task8_profile3_community[i] <- responses$`F-8-3-2`[i]
  }
  if(responses$`F-8-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task8_profile1_temp[i] <- responses$`F-8-1-3`[i]
    responses$task8_profile2_temp[i] <- responses$`F-8-2-3`[i]
    responses$task8_profile3_temp[i] <- responses$`F-8-3-3`[i]
  }
  if(responses$`F-8-3`[i]=="Most popular tourist attractions"){
    responses$task8_profile1_attractions[i] <- responses$`F-8-1-3`[i]
    responses$task8_profile2_attractions[i] <- responses$`F-8-2-3`[i]
    responses$task8_profile3_attractions[i] <- responses$`F-8-3-3`[i]
  }
  if(responses$`F-8-3`[i]=="Travel time from your home (by air)"){
    responses$task8_profile1_traveltime[i] <- responses$`F-8-1-3`[i]
    responses$task8_profile2_traveltime[i] <- responses$`F-8-2-3`[i]
    responses$task8_profile3_traveltime[i] <- responses$`F-8-3-3`[i]
  }
  if(responses$`F-8-3`[i]=="State-level 2020 presidential election result"){
    responses$task8_profile1_preselec[i] <- responses$`F-8-1-3`[i]
    responses$task8_profile2_preselec[i] <- responses$`F-8-2-3`[i]
    responses$task8_profile3_preselec[i] <- responses$`F-8-3-3`[i]
  }
  if(responses$`F-8-3`[i]=="Recent state news"){
    responses$task8_profile1_recentnews[i] <- responses$`F-8-1-3`[i]
    responses$task8_profile2_recentnews[i] <- responses$`F-8-2-3`[i]
    responses$task8_profile3_recentnews[i] <- responses$`F-8-3-3`[i]
  }
  if(responses$`F-8-3`[i]=="Destination community type"){
    responses$task8_profile1_community[i] <- responses$`F-8-1-3`[i]
    responses$task8_profile2_community[i] <- responses$`F-8-2-3`[i]
    responses$task8_profile3_community[i] <- responses$`F-8-3-3`[i]
  }
  if(responses$`F-8-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task8_profile1_temp[i] <- responses$`F-8-1-4`[i]
    responses$task8_profile2_temp[i] <- responses$`F-8-2-4`[i]
    responses$task8_profile3_temp[i] <- responses$`F-8-3-4`[i]
  }
  if(responses$`F-8-4`[i]=="Most popular tourist attractions"){
    responses$task8_profile1_attractions[i] <- responses$`F-8-1-4`[i]
    responses$task8_profile2_attractions[i] <- responses$`F-8-2-4`[i]
    responses$task8_profile3_attractions[i] <- responses$`F-8-3-4`[i]
  }
  if(responses$`F-8-4`[i]=="Travel time from your home (by air)"){
    responses$task8_profile1_traveltime[i] <- responses$`F-8-1-4`[i]
    responses$task8_profile2_traveltime[i] <- responses$`F-8-2-4`[i]
    responses$task8_profile3_traveltime[i] <- responses$`F-8-3-4`[i]
  }
  if(responses$`F-8-4`[i]=="State-level 2020 presidential election result"){
    responses$task8_profile1_preselec[i] <- responses$`F-8-1-4`[i]
    responses$task8_profile2_preselec[i] <- responses$`F-8-2-4`[i]
    responses$task8_profile3_preselec[i] <- responses$`F-8-3-4`[i]
  }
  if(responses$`F-8-4`[i]=="Recent state news"){
    responses$task8_profile1_recentnews[i] <- responses$`F-8-1-4`[i]
    responses$task8_profile2_recentnews[i] <- responses$`F-8-2-4`[i]
    responses$task8_profile3_recentnews[i] <- responses$`F-8-3-4`[i]
  }
  if(responses$`F-8-4`[i]=="Destination community type"){
    responses$task8_profile1_community[i] <- responses$`F-8-1-4`[i]
    responses$task8_profile2_community[i] <- responses$`F-8-2-4`[i]
    responses$task8_profile3_community[i] <- responses$`F-8-3-4`[i]
  }
  if(responses$`F-8-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task8_profile1_temp[i] <- responses$`F-8-1-5`[i]
    responses$task8_profile2_temp[i] <- responses$`F-8-2-5`[i]
    responses$task8_profile3_temp[i] <- responses$`F-8-3-5`[i]
  }
  if(responses$`F-8-5`[i]=="Most popular tourist attractions"){
    responses$task8_profile1_attractions[i] <- responses$`F-8-1-5`[i]
    responses$task8_profile2_attractions[i] <- responses$`F-8-2-5`[i]
    responses$task8_profile3_attractions[i] <- responses$`F-8-3-5`[i]
  }
  if(responses$`F-8-5`[i]=="Travel time from your home (by air)"){
    responses$task8_profile1_traveltime[i] <- responses$`F-8-1-5`[i]
    responses$task8_profile2_traveltime[i] <- responses$`F-8-2-5`[i]
    responses$task8_profile3_traveltime[i] <- responses$`F-8-3-5`[i]
  }
  if(responses$`F-8-5`[i]=="State-level 2020 presidential election result"){
    responses$task8_profile1_preselec[i] <- responses$`F-8-1-5`[i]
    responses$task8_profile2_preselec[i] <- responses$`F-8-2-5`[i]
    responses$task8_profile3_preselec[i] <- responses$`F-8-3-5`[i]
  }
  if(responses$`F-8-5`[i]=="Recent state news"){
    responses$task8_profile1_recentnews[i] <- responses$`F-8-1-5`[i]
    responses$task8_profile2_recentnews[i] <- responses$`F-8-2-5`[i]
    responses$task8_profile3_recentnews[i] <- responses$`F-8-3-5`[i]
  }
  if(responses$`F-8-5`[i]=="Destination community type"){
    responses$task8_profile1_community[i] <- responses$`F-8-1-5`[i]
    responses$task8_profile2_community[i] <- responses$`F-8-2-5`[i]
    responses$task8_profile3_community[i] <- responses$`F-8-3-5`[i]
  }
  if(responses$`F-8-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task8_profile1_temp[i] <- responses$`F-8-1-6`[i]
    responses$task8_profile2_temp[i] <- responses$`F-8-2-6`[i]
    responses$task8_profile3_temp[i] <- responses$`F-8-3-6`[i]
  }
  if(responses$`F-8-6`[i]=="Most popular tourist attractions"){
    responses$task8_profile1_attractions[i] <- responses$`F-8-1-6`[i]
    responses$task8_profile2_attractions[i] <- responses$`F-8-2-6`[i]
    responses$task8_profile3_attractions[i] <- responses$`F-8-3-6`[i]
  }
  if(responses$`F-8-6`[i]=="Travel time from your home (by air)"){
    responses$task8_profile1_traveltime[i] <- responses$`F-8-1-6`[i]
    responses$task8_profile2_traveltime[i] <- responses$`F-8-2-6`[i]
    responses$task8_profile3_traveltime[i] <- responses$`F-8-3-6`[i]
  }
  if(responses$`F-8-6`[i]=="State-level 2020 presidential election result"){
    responses$task8_profile1_preselec[i] <- responses$`F-8-1-6`[i]
    responses$task8_profile2_preselec[i] <- responses$`F-8-2-6`[i]
    responses$task8_profile3_preselec[i] <- responses$`F-8-3-6`[i]
  }
  if(responses$`F-8-6`[i]=="Recent state news"){
    responses$task8_profile1_recentnews[i] <- responses$`F-8-1-6`[i]
    responses$task8_profile2_recentnews[i] <- responses$`F-8-2-6`[i]
    responses$task8_profile3_recentnews[i] <- responses$`F-8-3-6`[i]
  }
  if(responses$`F-8-6`[i]=="Destination community type"){
    responses$task8_profile1_community[i] <- responses$`F-8-1-6`[i]
    responses$task8_profile2_community[i] <- responses$`F-8-2-6`[i]
    responses$task8_profile3_community[i] <- responses$`F-8-3-6`[i]
  }
  if(responses$`F-9-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task9_profile1_temp[i] <- responses$`F-9-1-1`[i]
    responses$task9_profile2_temp[i] <- responses$`F-9-2-1`[i]
    responses$task9_profile3_temp[i] <- responses$`F-9-3-1`[i]
  }
  if(responses$`F-9-1`[i]=="Most popular tourist attractions"){
    responses$task9_profile1_attractions[i] <- responses$`F-9-1-1`[i]
    responses$task9_profile2_attractions[i] <- responses$`F-9-2-1`[i]
    responses$task9_profile3_attractions[i] <- responses$`F-9-3-1`[i]
  }
  if(responses$`F-9-1`[i]=="Travel time from your home (by air)"){
    responses$task9_profile1_traveltime[i] <- responses$`F-9-1-1`[i]
    responses$task9_profile2_traveltime[i] <- responses$`F-9-2-1`[i]
    responses$task9_profile3_traveltime[i] <- responses$`F-9-3-1`[i]
  }
  if(responses$`F-9-1`[i]=="State-level 2020 presidential election result"){
    responses$task9_profile1_preselec[i] <- responses$`F-9-1-1`[i]
    responses$task9_profile2_preselec[i] <- responses$`F-9-2-1`[i]
    responses$task9_profile3_preselec[i] <- responses$`F-9-3-1`[i]
  }
  if(responses$`F-9-1`[i]=="Recent state news"){
    responses$task9_profile1_recentnews[i] <- responses$`F-9-1-1`[i]
    responses$task9_profile2_recentnews[i] <- responses$`F-9-2-1`[i]
    responses$task9_profile3_recentnews[i] <- responses$`F-9-3-1`[i]
  }
  if(responses$`F-9-1`[i]=="Destination community type"){
    responses$task9_profile1_community[i] <- responses$`F-9-1-1`[i]
    responses$task9_profile2_community[i] <- responses$`F-9-2-1`[i]
    responses$task9_profile3_community[i] <- responses$`F-9-3-1`[i]
  }
  if(responses$`F-9-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task9_profile1_temp[i] <- responses$`F-9-1-2`[i]
    responses$task9_profile2_temp[i] <- responses$`F-9-2-2`[i]
    responses$task9_profile3_temp[i] <- responses$`F-9-3-2`[i]
  }
  if(responses$`F-9-2`[i]=="Most popular tourist attractions"){
    responses$task9_profile1_attractions[i] <- responses$`F-9-1-2`[i]
    responses$task9_profile2_attractions[i] <- responses$`F-9-2-2`[i]
    responses$task9_profile3_attractions[i] <- responses$`F-9-3-2`[i]
  }
  if(responses$`F-9-2`[i]=="Travel time from your home (by air)"){
    responses$task9_profile1_traveltime[i] <- responses$`F-9-1-2`[i]
    responses$task9_profile2_traveltime[i] <- responses$`F-9-2-2`[i]
    responses$task9_profile3_traveltime[i] <- responses$`F-9-3-2`[i]
  }
  if(responses$`F-9-2`[i]=="State-level 2020 presidential election result"){
    responses$task9_profile1_preselec[i] <- responses$`F-9-1-2`[i]
    responses$task9_profile2_preselec[i] <- responses$`F-9-2-2`[i]
    responses$task9_profile3_preselec[i] <- responses$`F-9-3-2`[i]
  }
  if(responses$`F-9-2`[i]=="Recent state news"){
    responses$task9_profile1_recentnews[i] <- responses$`F-9-1-2`[i]
    responses$task9_profile2_recentnews[i] <- responses$`F-9-2-2`[i]
    responses$task9_profile3_recentnews[i] <- responses$`F-9-3-2`[i]
  }
  if(responses$`F-9-2`[i]=="Destination community type"){
    responses$task9_profile1_community[i] <- responses$`F-9-1-2`[i]
    responses$task9_profile2_community[i] <- responses$`F-9-2-2`[i]
    responses$task9_profile3_community[i] <- responses$`F-9-3-2`[i]
  }
  if(responses$`F-9-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task9_profile1_temp[i] <- responses$`F-9-1-3`[i]
    responses$task9_profile2_temp[i] <- responses$`F-9-2-3`[i]
    responses$task9_profile3_temp[i] <- responses$`F-9-3-3`[i]
  }
  if(responses$`F-9-3`[i]=="Most popular tourist attractions"){
    responses$task9_profile1_attractions[i] <- responses$`F-9-1-3`[i]
    responses$task9_profile2_attractions[i] <- responses$`F-9-2-3`[i]
    responses$task9_profile3_attractions[i] <- responses$`F-9-3-3`[i]
  }
  if(responses$`F-9-3`[i]=="Travel time from your home (by air)"){
    responses$task9_profile1_traveltime[i] <- responses$`F-9-1-3`[i]
    responses$task9_profile2_traveltime[i] <- responses$`F-9-2-3`[i]
    responses$task9_profile3_traveltime[i] <- responses$`F-9-3-3`[i]
  }
  if(responses$`F-9-3`[i]=="State-level 2020 presidential election result"){
    responses$task9_profile1_preselec[i] <- responses$`F-9-1-3`[i]
    responses$task9_profile2_preselec[i] <- responses$`F-9-2-3`[i]
    responses$task9_profile3_preselec[i] <- responses$`F-9-3-3`[i]
  }
  if(responses$`F-9-3`[i]=="Recent state news"){
    responses$task9_profile1_recentnews[i] <- responses$`F-9-1-3`[i]
    responses$task9_profile2_recentnews[i] <- responses$`F-9-2-3`[i]
    responses$task9_profile3_recentnews[i] <- responses$`F-9-3-3`[i]
  }
  if(responses$`F-9-3`[i]=="Destination community type"){
    responses$task9_profile1_community[i] <- responses$`F-9-1-3`[i]
    responses$task9_profile2_community[i] <- responses$`F-9-2-3`[i]
    responses$task9_profile3_community[i] <- responses$`F-9-3-3`[i]
  }
  if(responses$`F-9-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task9_profile1_temp[i] <- responses$`F-9-1-4`[i]
    responses$task9_profile2_temp[i] <- responses$`F-9-2-4`[i]
    responses$task9_profile3_temp[i] <- responses$`F-9-3-4`[i]
  }
  if(responses$`F-9-4`[i]=="Most popular tourist attractions"){
    responses$task9_profile1_attractions[i] <- responses$`F-9-1-4`[i]
    responses$task9_profile2_attractions[i] <- responses$`F-9-2-4`[i]
    responses$task9_profile3_attractions[i] <- responses$`F-9-3-4`[i]
  }
  if(responses$`F-9-4`[i]=="Travel time from your home (by air)"){
    responses$task9_profile1_traveltime[i] <- responses$`F-9-1-4`[i]
    responses$task9_profile2_traveltime[i] <- responses$`F-9-2-4`[i]
    responses$task9_profile3_traveltime[i] <- responses$`F-9-3-4`[i]
  }
  if(responses$`F-9-4`[i]=="State-level 2020 presidential election result"){
    responses$task9_profile1_preselec[i] <- responses$`F-9-1-4`[i]
    responses$task9_profile2_preselec[i] <- responses$`F-9-2-4`[i]
    responses$task9_profile3_preselec[i] <- responses$`F-9-3-4`[i]
  }
  if(responses$`F-9-4`[i]=="Recent state news"){
    responses$task9_profile1_recentnews[i] <- responses$`F-9-1-4`[i]
    responses$task9_profile2_recentnews[i] <- responses$`F-9-2-4`[i]
    responses$task9_profile3_recentnews[i] <- responses$`F-9-3-4`[i]
  }
  if(responses$`F-9-4`[i]=="Destination community type"){
    responses$task9_profile1_community[i] <- responses$`F-9-1-4`[i]
    responses$task9_profile2_community[i] <- responses$`F-9-2-4`[i]
    responses$task9_profile3_community[i] <- responses$`F-9-3-4`[i]
  }
  if(responses$`F-9-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task9_profile1_temp[i] <- responses$`F-9-1-5`[i]
    responses$task9_profile2_temp[i] <- responses$`F-9-2-5`[i]
    responses$task9_profile3_temp[i] <- responses$`F-9-3-5`[i]
  }
  if(responses$`F-9-5`[i]=="Most popular tourist attractions"){
    responses$task9_profile1_attractions[i] <- responses$`F-9-1-5`[i]
    responses$task9_profile2_attractions[i] <- responses$`F-9-2-5`[i]
    responses$task9_profile3_attractions[i] <- responses$`F-9-3-5`[i]
  }
  if(responses$`F-9-5`[i]=="Travel time from your home (by air)"){
    responses$task9_profile1_traveltime[i] <- responses$`F-9-1-5`[i]
    responses$task9_profile2_traveltime[i] <- responses$`F-9-2-5`[i]
    responses$task9_profile3_traveltime[i] <- responses$`F-9-3-5`[i]
  }
  if(responses$`F-9-5`[i]=="State-level 2020 presidential election result"){
    responses$task9_profile1_preselec[i] <- responses$`F-9-1-5`[i]
    responses$task9_profile2_preselec[i] <- responses$`F-9-2-5`[i]
    responses$task9_profile3_preselec[i] <- responses$`F-9-3-5`[i]
  }
  if(responses$`F-9-5`[i]=="Recent state news"){
    responses$task9_profile1_recentnews[i] <- responses$`F-9-1-5`[i]
    responses$task9_profile2_recentnews[i] <- responses$`F-9-2-5`[i]
    responses$task9_profile3_recentnews[i] <- responses$`F-9-3-5`[i]
  }
  if(responses$`F-9-5`[i]=="Destination community type"){
    responses$task9_profile1_community[i] <- responses$`F-9-1-5`[i]
    responses$task9_profile2_community[i] <- responses$`F-9-2-5`[i]
    responses$task9_profile3_community[i] <- responses$`F-9-3-5`[i]
  }
  if(responses$`F-9-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task9_profile1_temp[i] <- responses$`F-9-1-6`[i]
    responses$task9_profile2_temp[i] <- responses$`F-9-2-6`[i]
    responses$task9_profile3_temp[i] <- responses$`F-9-3-6`[i]
  }
  if(responses$`F-9-6`[i]=="Most popular tourist attractions"){
    responses$task9_profile1_attractions[i] <- responses$`F-9-1-6`[i]
    responses$task9_profile2_attractions[i] <- responses$`F-9-2-6`[i]
    responses$task9_profile3_attractions[i] <- responses$`F-9-3-6`[i]
  }
  if(responses$`F-9-6`[i]=="Travel time from your home (by air)"){
    responses$task9_profile1_traveltime[i] <- responses$`F-9-1-6`[i]
    responses$task9_profile2_traveltime[i] <- responses$`F-9-2-6`[i]
    responses$task9_profile3_traveltime[i] <- responses$`F-9-3-6`[i]
  }
  if(responses$`F-9-6`[i]=="State-level 2020 presidential election result"){
    responses$task9_profile1_preselec[i] <- responses$`F-9-1-6`[i]
    responses$task9_profile2_preselec[i] <- responses$`F-9-2-6`[i]
    responses$task9_profile3_preselec[i] <- responses$`F-9-3-6`[i]
  }
  if(responses$`F-9-6`[i]=="Recent state news"){
    responses$task9_profile1_recentnews[i] <- responses$`F-9-1-6`[i]
    responses$task9_profile2_recentnews[i] <- responses$`F-9-2-6`[i]
    responses$task9_profile3_recentnews[i] <- responses$`F-9-3-6`[i]
  }
  if(responses$`F-9-6`[i]=="Destination community type"){
    responses$task9_profile1_community[i] <- responses$`F-9-1-6`[i]
    responses$task9_profile2_community[i] <- responses$`F-9-2-6`[i]
    responses$task9_profile3_community[i] <- responses$`F-9-3-6`[i]
  }
  if(responses$`F-10-1`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task10_profile1_temp[i] <- responses$`F-10-1-1`[i]
    responses$task10_profile2_temp[i] <- responses$`F-10-2-1`[i]
    responses$task10_profile3_temp[i] <- responses$`F-10-3-1`[i]
  }
  if(responses$`F-10-1`[i]=="Most popular tourist attractions"){
    responses$task10_profile1_attractions[i] <- responses$`F-10-1-1`[i]
    responses$task10_profile2_attractions[i] <- responses$`F-10-2-1`[i]
    responses$task10_profile3_attractions[i] <- responses$`F-10-3-1`[i]
  }
  if(responses$`F-10-1`[i]=="Travel time from your home (by air)"){
    responses$task10_profile1_traveltime[i] <- responses$`F-10-1-1`[i]
    responses$task10_profile2_traveltime[i] <- responses$`F-10-2-1`[i]
    responses$task10_profile3_traveltime[i] <- responses$`F-10-3-1`[i]
  }
  if(responses$`F-10-1`[i]=="State-level 2020 presidential election result"){
    responses$task10_profile1_preselec[i] <- responses$`F-10-1-1`[i]
    responses$task10_profile2_preselec[i] <- responses$`F-10-2-1`[i]
    responses$task10_profile3_preselec[i] <- responses$`F-10-3-1`[i]
  }
  if(responses$`F-10-1`[i]=="Recent state news"){
    responses$task10_profile1_recentnews[i] <- responses$`F-10-1-1`[i]
    responses$task10_profile2_recentnews[i] <- responses$`F-10-2-1`[i]
    responses$task10_profile3_recentnews[i] <- responses$`F-10-3-1`[i]
  }
  if(responses$`F-10-1`[i]=="Destination community type"){
    responses$task10_profile1_community[i] <- responses$`F-10-1-1`[i]
    responses$task10_profile2_community[i] <- responses$`F-10-2-1`[i]
    responses$task10_profile3_community[i] <- responses$`F-10-3-1`[i]
  }
  if(responses$`F-10-2`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task10_profile1_temp[i] <- responses$`F-10-1-2`[i]
    responses$task10_profile2_temp[i] <- responses$`F-10-2-2`[i]
    responses$task10_profile3_temp[i] <- responses$`F-10-3-2`[i]
  }
  if(responses$`F-10-2`[i]=="Most popular tourist attractions"){
    responses$task10_profile1_attractions[i] <- responses$`F-10-1-2`[i]
    responses$task10_profile2_attractions[i] <- responses$`F-10-2-2`[i]
    responses$task10_profile3_attractions[i] <- responses$`F-10-3-2`[i]
  }
  if(responses$`F-10-2`[i]=="Travel time from your home (by air)"){
    responses$task10_profile1_traveltime[i] <- responses$`F-10-1-2`[i]
    responses$task10_profile2_traveltime[i] <- responses$`F-10-2-2`[i]
    responses$task10_profile3_traveltime[i] <- responses$`F-10-3-2`[i]
  }
  if(responses$`F-10-2`[i]=="State-level 2020 presidential election result"){
    responses$task10_profile1_preselec[i] <- responses$`F-10-1-2`[i]
    responses$task10_profile2_preselec[i] <- responses$`F-10-2-2`[i]
    responses$task10_profile3_preselec[i] <- responses$`F-10-3-2`[i]
  }
  if(responses$`F-10-2`[i]=="Recent state news"){
    responses$task10_profile1_recentnews[i] <- responses$`F-10-1-2`[i]
    responses$task10_profile2_recentnews[i] <- responses$`F-10-2-2`[i]
    responses$task10_profile3_recentnews[i] <- responses$`F-10-3-2`[i]
  }
  if(responses$`F-10-2`[i]=="Destination community type"){
    responses$task10_profile1_community[i] <- responses$`F-10-1-2`[i]
    responses$task10_profile2_community[i] <- responses$`F-10-2-2`[i]
    responses$task10_profile3_community[i] <- responses$`F-10-3-2`[i]
  }
  if(responses$`F-10-3`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task10_profile1_temp[i] <- responses$`F-10-1-3`[i]
    responses$task10_profile2_temp[i] <- responses$`F-10-2-3`[i]
    responses$task10_profile3_temp[i] <- responses$`F-10-3-3`[i]
  }
  if(responses$`F-10-3`[i]=="Most popular tourist attractions"){
    responses$task10_profile1_attractions[i] <- responses$`F-10-1-3`[i]
    responses$task10_profile2_attractions[i] <- responses$`F-10-2-3`[i]
    responses$task10_profile3_attractions[i] <- responses$`F-10-3-3`[i]
  }
  if(responses$`F-10-3`[i]=="Travel time from your home (by air)"){
    responses$task10_profile1_traveltime[i] <- responses$`F-10-1-3`[i]
    responses$task10_profile2_traveltime[i] <- responses$`F-10-2-3`[i]
    responses$task10_profile3_traveltime[i] <- responses$`F-10-3-3`[i]
  }
  if(responses$`F-10-3`[i]=="State-level 2020 presidential election result"){
    responses$task10_profile1_preselec[i] <- responses$`F-10-1-3`[i]
    responses$task10_profile2_preselec[i] <- responses$`F-10-2-3`[i]
    responses$task10_profile3_preselec[i] <- responses$`F-10-3-3`[i]
  }
  if(responses$`F-10-3`[i]=="Recent state news"){
    responses$task10_profile1_recentnews[i] <- responses$`F-10-1-3`[i]
    responses$task10_profile2_recentnews[i] <- responses$`F-10-2-3`[i]
    responses$task10_profile3_recentnews[i] <- responses$`F-10-3-3`[i]
  }
  if(responses$`F-10-3`[i]=="Destination community type"){
    responses$task10_profile1_community[i] <- responses$`F-10-1-3`[i]
    responses$task10_profile2_community[i] <- responses$`F-10-2-3`[i]
    responses$task10_profile3_community[i] <- responses$`F-10-3-3`[i]
  }
  if(responses$`F-10-4`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task10_profile1_temp[i] <- responses$`F-10-1-4`[i]
    responses$task10_profile2_temp[i] <- responses$`F-10-2-4`[i]
    responses$task10_profile3_temp[i] <- responses$`F-10-3-4`[i]
  }
  if(responses$`F-10-4`[i]=="Most popular tourist attractions"){
    responses$task10_profile1_attractions[i] <- responses$`F-10-1-4`[i]
    responses$task10_profile2_attractions[i] <- responses$`F-10-2-4`[i]
    responses$task10_profile3_attractions[i] <- responses$`F-10-3-4`[i]
  }
  if(responses$`F-10-4`[i]=="Travel time from your home (by air)"){
    responses$task10_profile1_traveltime[i] <- responses$`F-10-1-4`[i]
    responses$task10_profile2_traveltime[i] <- responses$`F-10-2-4`[i]
    responses$task10_profile3_traveltime[i] <- responses$`F-10-3-4`[i]
  }
  if(responses$`F-10-4`[i]=="State-level 2020 presidential election result"){
    responses$task10_profile1_preselec[i] <- responses$`F-10-1-4`[i]
    responses$task10_profile2_preselec[i] <- responses$`F-10-2-4`[i]
    responses$task10_profile3_preselec[i] <- responses$`F-10-3-4`[i]
  }
  if(responses$`F-10-4`[i]=="Recent state news"){
    responses$task10_profile1_recentnews[i] <- responses$`F-10-1-4`[i]
    responses$task10_profile2_recentnews[i] <- responses$`F-10-2-4`[i]
    responses$task10_profile3_recentnews[i] <- responses$`F-10-3-4`[i]
  }
  if(responses$`F-10-4`[i]=="Destination community type"){
    responses$task10_profile1_community[i] <- responses$`F-10-1-4`[i]
    responses$task10_profile2_community[i] <- responses$`F-10-2-4`[i]
    responses$task10_profile3_community[i] <- responses$`F-10-3-4`[i]
  }
  if(responses$`F-10-5`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task10_profile1_temp[i] <- responses$`F-10-1-5`[i]
    responses$task10_profile2_temp[i] <- responses$`F-10-2-5`[i]
    responses$task10_profile3_temp[i] <- responses$`F-10-3-5`[i]
  }
  if(responses$`F-10-5`[i]=="Most popular tourist attractions"){
    responses$task10_profile1_attractions[i] <- responses$`F-10-1-5`[i]
    responses$task10_profile2_attractions[i] <- responses$`F-10-2-5`[i]
    responses$task10_profile3_attractions[i] <- responses$`F-10-3-5`[i]
  }
  if(responses$`F-10-5`[i]=="Travel time from your home (by air)"){
    responses$task10_profile1_traveltime[i] <- responses$`F-10-1-5`[i]
    responses$task10_profile2_traveltime[i] <- responses$`F-10-2-5`[i]
    responses$task10_profile3_traveltime[i] <- responses$`F-10-3-5`[i]
  }
  if(responses$`F-10-5`[i]=="State-level 2020 presidential election result"){
    responses$task10_profile1_preselec[i] <- responses$`F-10-1-5`[i]
    responses$task10_profile2_preselec[i] <- responses$`F-10-2-5`[i]
    responses$task10_profile3_preselec[i] <- responses$`F-10-3-5`[i]
  }
  if(responses$`F-10-5`[i]=="Recent state news"){
    responses$task10_profile1_recentnews[i] <- responses$`F-10-1-5`[i]
    responses$task10_profile2_recentnews[i] <- responses$`F-10-2-5`[i]
    responses$task10_profile3_recentnews[i] <- responses$`F-10-3-5`[i]
  }
  if(responses$`F-10-5`[i]=="Destination community type"){
    responses$task10_profile1_community[i] <- responses$`F-10-1-5`[i]
    responses$task10_profile2_community[i] <- responses$`F-10-2-5`[i]
    responses$task10_profile3_community[i] <- responses$`F-10-3-5`[i]
  }
  if(responses$`F-10-6`[i]=="Average July Temperature (in degrees Fahrenheit)"){
    responses$task10_profile1_temp[i] <- responses$`F-10-1-6`[i]
    responses$task10_profile2_temp[i] <- responses$`F-10-2-6`[i]
    responses$task10_profile3_temp[i] <- responses$`F-10-3-6`[i]
  }
  if(responses$`F-10-6`[i]=="Most popular tourist attractions"){
    responses$task10_profile1_attractions[i] <- responses$`F-10-1-6`[i]
    responses$task10_profile2_attractions[i] <- responses$`F-10-2-6`[i]
    responses$task10_profile3_attractions[i] <- responses$`F-10-3-6`[i]
  }
  if(responses$`F-10-6`[i]=="Travel time from your home (by air)"){
    responses$task10_profile1_traveltime[i] <- responses$`F-10-1-6`[i]
    responses$task10_profile2_traveltime[i] <- responses$`F-10-2-6`[i]
    responses$task10_profile3_traveltime[i] <- responses$`F-10-3-6`[i]
  }
  if(responses$`F-10-6`[i]=="State-level 2020 presidential election result"){
    responses$task10_profile1_preselec[i] <- responses$`F-10-1-6`[i]
    responses$task10_profile2_preselec[i] <- responses$`F-10-2-6`[i]
    responses$task10_profile3_preselec[i] <- responses$`F-10-3-6`[i]
  }
  if(responses$`F-10-6`[i]=="Recent state news"){
    responses$task10_profile1_recentnews[i] <- responses$`F-10-1-6`[i]
    responses$task10_profile2_recentnews[i] <- responses$`F-10-2-6`[i]
    responses$task10_profile3_recentnews[i] <- responses$`F-10-3-6`[i]
  }
  if(responses$`F-10-6`[i]=="Destination community type"){
    responses$task10_profile1_community[i] <- responses$`F-10-1-6`[i]
    responses$task10_profile2_community[i] <- responses$`F-10-2-6`[i]
    responses$task10_profile3_community[i] <- responses$`F-10-3-6`[i]
  }
  print(i)
}

# creating empty slots for the rating of each profile and the choice in each
# task

responses$task1_profile1_rating <- NA
responses$task1_profile2_rating <- NA
responses$task1_profile3_rating <- NA
responses$task1_profile1_choice <- NA
responses$task1_profile2_choice <- NA
responses$task1_profile3_choice <- NA
responses$task2_profile1_rating <- NA
responses$task2_profile2_rating <- NA
responses$task2_profile3_rating <- NA
responses$task2_profile1_choice <- NA
responses$task2_profile2_choice <- NA
responses$task2_profile3_choice <- NA
responses$task3_profile1_rating <- NA
responses$task3_profile2_rating <- NA
responses$task3_profile3_rating <- NA
responses$task3_profile1_choice <- NA
responses$task3_profile2_choice <- NA
responses$task3_profile3_choice <- NA
responses$task4_profile1_rating <- NA
responses$task4_profile2_rating <- NA
responses$task4_profile3_rating <- NA
responses$task4_profile1_choice <- NA
responses$task4_profile2_choice <- NA
responses$task4_profile3_choice <- NA
responses$task5_profile1_rating <- NA
responses$task5_profile2_rating <- NA
responses$task5_profile3_rating <- NA
responses$task5_profile1_choice <- NA
responses$task5_profile2_choice <- NA
responses$task5_profile3_choice <- NA
responses$task6_profile1_rating <- NA
responses$task6_profile2_rating <- NA
responses$task6_profile3_rating <- NA
responses$task6_profile1_choice <- NA
responses$task6_profile2_choice <- NA
responses$task6_profile3_choice <- NA
responses$task7_profile1_rating <- NA
responses$task7_profile2_rating <- NA
responses$task7_profile3_rating <- NA
responses$task7_profile1_choice <- NA
responses$task7_profile2_choice <- NA
responses$task7_profile3_choice <- NA
responses$task8_profile1_rating <- NA
responses$task8_profile2_rating <- NA
responses$task8_profile3_rating <- NA
responses$task8_profile1_choice <- NA
responses$task8_profile2_choice <- NA
responses$task8_profile3_choice <- NA
responses$task9_profile1_rating <- NA
responses$task9_profile2_rating <- NA
responses$task9_profile3_rating <- NA
responses$task9_profile1_choice <- NA
responses$task9_profile2_choice <- NA
responses$task9_profile3_choice <- NA
responses$task10_profile1_rating <- NA
responses$task10_profile2_rating <- NA
responses$task10_profile3_rating <- NA
responses$task10_profile1_choice <- NA
responses$task10_profile2_choice <- NA
responses$task10_profile3_choice <- NA

# function to recode the "interest level" responses to numeric

interest_recode <- function(x){
  tmp <- car::recode(x,"'Not at all interested'='1';
                    'Slightly interested'='2';
                    'Somewhat interested'='3';
                    'Very interested'='4';
                    'Extremely interested'='5';
                    else=NA")
  return(as.character(tmp))
}

# the following series of if-else statements assigns to the empty slots
# the ratings and choices for each profile/task created above, respectively

responses$task1_profile1_rating <- ifelse(responses$Q62_1!="", interest_recode(responses$Q62_1), responses$task1_profile1_rating)
responses$task1_profile2_rating <- ifelse(responses$Q62_2!="", interest_recode(responses$Q62_2), responses$task1_profile2_rating)
responses$task1_profile3_rating <- ifelse(responses$Q62_3!="", interest_recode(responses$Q62_3), responses$task1_profile3_rating)
responses$task1_profile1_choice <- ifelse(responses$Q63=="Destination 1", 1, responses$task1_profile1_choice)
responses$task1_profile1_choice <- ifelse(responses$Q63!="Destination 1" & responses$Q63!="", 0, responses$task1_profile1_choice)
responses$task1_profile2_choice <- ifelse(responses$Q63=="Destination 2", 1, responses$task1_profile2_choice)
responses$task1_profile2_choice <- ifelse(responses$Q63!="Destination 2" & responses$Q63!="", 0, responses$task1_profile2_choice)
responses$task1_profile3_choice <- ifelse(responses$Q63=="Destination 3", 1, responses$task1_profile3_choice)
responses$task1_profile3_choice <- ifelse(responses$Q63!="Destination 3" & responses$Q63!="", 0, responses$task1_profile3_choice)

responses$task2_profile1_rating <- ifelse(responses$Q259_1!="", interest_recode(responses$Q259_1), responses$task2_profile1_rating)
responses$task2_profile2_rating <- ifelse(responses$Q259_2!="", interest_recode(responses$Q259_2), responses$task2_profile2_rating)
responses$task2_profile3_rating <- ifelse(responses$Q259_3!="", interest_recode(responses$Q259_3), responses$task2_profile3_rating)
responses$task2_profile1_choice <- ifelse(responses$Q260=="Destination 1", 1, responses$task2_profile1_choice)
responses$task2_profile1_choice <- ifelse(responses$Q260!="Destination 1" & responses$Q260!="", 0, responses$task2_profile1_choice)
responses$task2_profile2_choice <- ifelse(responses$Q260=="Destination 2", 1, responses$task2_profile2_choice)
responses$task2_profile2_choice <- ifelse(responses$Q260!="Destination 2" & responses$Q260!="", 0, responses$task2_profile2_choice)
responses$task2_profile3_choice <- ifelse(responses$Q260=="Destination 3", 1, responses$task2_profile3_choice)
responses$task2_profile3_choice <- ifelse(responses$Q260!="Destination 3" & responses$Q260!="", 0, responses$task2_profile3_choice)

responses$task3_profile1_rating <- ifelse(responses$Q262_1!="", interest_recode(responses$Q262_1), responses$task3_profile1_rating)
responses$task3_profile2_rating <- ifelse(responses$Q262_2!="", interest_recode(responses$Q262_2), responses$task3_profile2_rating)
responses$task3_profile3_rating <- ifelse(responses$Q262_3!="", interest_recode(responses$Q262_3), responses$task3_profile3_rating)
responses$task3_profile1_choice <- ifelse(responses$Q263=="Destination 1", 1, responses$task3_profile1_choice)
responses$task3_profile1_choice <- ifelse(responses$Q263!="Destination 1" & responses$Q263!="", 0, responses$task3_profile1_choice)
responses$task3_profile2_choice <- ifelse(responses$Q263=="Destination 2", 1, responses$task3_profile2_choice)
responses$task3_profile2_choice <- ifelse(responses$Q263!="Destination 2" & responses$Q263!="", 0, responses$task3_profile2_choice)
responses$task3_profile3_choice <- ifelse(responses$Q263=="Destination 3", 1, responses$task3_profile3_choice)
responses$task3_profile3_choice <- ifelse(responses$Q263!="Destination 3" & responses$Q263!="", 0, responses$task3_profile3_choice)

responses$task4_profile1_rating <- ifelse(responses$Q265_1!="", interest_recode(responses$Q265_1), responses$task4_profile1_rating)
responses$task4_profile2_rating <- ifelse(responses$Q265_2!="", interest_recode(responses$Q265_2), responses$task4_profile2_rating)
responses$task4_profile3_rating <- ifelse(responses$Q265_3!="", interest_recode(responses$Q265_3), responses$task4_profile3_rating)
responses$task4_profile1_choice <- ifelse(responses$Q266=="Destination 1", 1, responses$task4_profile1_choice)
responses$task4_profile1_choice <- ifelse(responses$Q266!="Destination 1" & responses$Q266!="", 0, responses$task4_profile1_choice)
responses$task4_profile2_choice <- ifelse(responses$Q266=="Destination 2", 1, responses$task4_profile2_choice)
responses$task4_profile2_choice <- ifelse(responses$Q266!="Destination 2" & responses$Q266!="", 0, responses$task4_profile2_choice)
responses$task4_profile3_choice <- ifelse(responses$Q266=="Destination 3", 1, responses$task4_profile3_choice)
responses$task4_profile3_choice <- ifelse(responses$Q266!="Destination 3" & responses$Q266!="", 0, responses$task4_profile3_choice)

responses$task5_profile1_rating <- ifelse(responses$Q268_1!="", interest_recode(responses$Q268_1), responses$task5_profile1_rating)
responses$task5_profile2_rating <- ifelse(responses$Q268_2!="", interest_recode(responses$Q268_2), responses$task5_profile2_rating)
responses$task5_profile3_rating <- ifelse(responses$Q268_3!="", interest_recode(responses$Q268_3), responses$task5_profile3_rating)
responses$task5_profile1_choice <- ifelse(responses$Q269=="Destination 1", 1, responses$task5_profile1_choice)
responses$task5_profile1_choice <- ifelse(responses$Q269!="Destination 1" & responses$Q269!="", 0, responses$task5_profile1_choice)
responses$task5_profile2_choice <- ifelse(responses$Q269=="Destination 2", 1, responses$task5_profile2_choice)
responses$task5_profile2_choice <- ifelse(responses$Q269!="Destination 2" & responses$Q269!="", 0, responses$task5_profile2_choice)
responses$task5_profile3_choice <- ifelse(responses$Q269=="Destination 3", 1, responses$task5_profile3_choice)
responses$task5_profile3_choice <- ifelse(responses$Q269!="Destination 3" & responses$Q269!="", 0, responses$task5_profile3_choice)

responses$task6_profile1_rating <- ifelse(responses$Q271_1!="", interest_recode(responses$Q271_1), responses$task6_profile1_rating)
responses$task6_profile2_rating <- ifelse(responses$Q271_2!="", interest_recode(responses$Q271_2), responses$task6_profile2_rating)
responses$task6_profile3_rating <- ifelse(responses$Q271_3!="", interest_recode(responses$Q271_3), responses$task6_profile3_rating)
responses$task6_profile1_choice <- ifelse(responses$Q272=="Destination 1", 1, responses$task6_profile1_choice)
responses$task6_profile1_choice <- ifelse(responses$Q272!="Destination 1" & responses$Q272!="", 0, responses$task6_profile1_choice)
responses$task6_profile2_choice <- ifelse(responses$Q272=="Destination 2", 1, responses$task6_profile2_choice)
responses$task6_profile2_choice <- ifelse(responses$Q272!="Destination 2" & responses$Q272!="", 0, responses$task6_profile2_choice)
responses$task6_profile3_choice <- ifelse(responses$Q272=="Destination 3", 1, responses$task6_profile3_choice)
responses$task6_profile3_choice <- ifelse(responses$Q272!="Destination 3" & responses$Q272!="", 0, responses$task6_profile3_choice)

responses$task7_profile1_rating <- ifelse(responses$Q274_1!="", interest_recode(responses$Q274_1), responses$task7_profile1_rating)
responses$task7_profile2_rating <- ifelse(responses$Q274_2!="", interest_recode(responses$Q274_2), responses$task7_profile2_rating)
responses$task7_profile3_rating <- ifelse(responses$Q274_3!="", interest_recode(responses$Q274_3), responses$task7_profile3_rating)
responses$task7_profile1_choice <- ifelse(responses$Q275=="Destination 1", 1, responses$task7_profile1_choice)
responses$task7_profile1_choice <- ifelse(responses$Q275!="Destination 1" & responses$Q275!="", 0, responses$task7_profile1_choice)
responses$task7_profile2_choice <- ifelse(responses$Q275=="Destination 2", 1, responses$task7_profile2_choice)
responses$task7_profile2_choice <- ifelse(responses$Q275!="Destination 2" & responses$Q275!="", 0, responses$task7_profile2_choice)
responses$task7_profile3_choice <- ifelse(responses$Q275=="Destination 3", 1, responses$task7_profile3_choice)
responses$task7_profile3_choice <- ifelse(responses$Q275!="Destination 3" & responses$Q275!="", 0, responses$task7_profile3_choice)

responses$task8_profile1_rating <- ifelse(responses$Q277_1!="", interest_recode(responses$Q277_1), responses$task8_profile1_rating)
responses$task8_profile2_rating <- ifelse(responses$Q277_2!="", interest_recode(responses$Q277_2), responses$task8_profile2_rating)
responses$task8_profile3_rating <- ifelse(responses$Q277_3!="", interest_recode(responses$Q277_3), responses$task8_profile3_rating)
responses$task8_profile1_choice <- ifelse(responses$Q278=="Destination 1", 1, responses$task8_profile1_choice)
responses$task8_profile1_choice <- ifelse(responses$Q278!="Destination 1" & responses$Q278!="", 0, responses$task8_profile1_choice)
responses$task8_profile2_choice <- ifelse(responses$Q278=="Destination 2", 1, responses$task8_profile2_choice)
responses$task8_profile2_choice <- ifelse(responses$Q278!="Destination 2" & responses$Q278!="", 0, responses$task8_profile2_choice)
responses$task8_profile3_choice <- ifelse(responses$Q278=="Destination 3", 1, responses$task8_profile3_choice)
responses$task8_profile3_choice <- ifelse(responses$Q278!="Destination 3" & responses$Q278!="", 0, responses$task8_profile3_choice)

responses$task9_profile1_rating <- ifelse(responses$Q280_1!="", interest_recode(responses$Q280_1), responses$task9_profile1_rating)
responses$task9_profile2_rating <- ifelse(responses$Q280_2!="", interest_recode(responses$Q280_2), responses$task9_profile2_rating)
responses$task9_profile3_rating <- ifelse(responses$Q280_3!="", interest_recode(responses$Q280_3), responses$task9_profile3_rating)
responses$task9_profile1_choice <- ifelse(responses$Q281=="Destination 1", 1, responses$task9_profile1_choice)
responses$task9_profile1_choice <- ifelse(responses$Q281!="Destination 1" & responses$Q281!="", 0, responses$task9_profile1_choice)
responses$task9_profile2_choice <- ifelse(responses$Q281=="Destination 2", 1, responses$task9_profile2_choice)
responses$task9_profile2_choice <- ifelse(responses$Q281!="Destination 2" & responses$Q281!="", 0, responses$task9_profile2_choice)
responses$task9_profile3_choice <- ifelse(responses$Q281=="Destination 3", 1, responses$task9_profile3_choice)
responses$task9_profile3_choice <- ifelse(responses$Q281!="Destination 3" & responses$Q281!="", 0, responses$task9_profile3_choice)

responses$task10_profile1_rating <- ifelse(responses$Q283_1!="", interest_recode(responses$Q283_1), responses$task10_profile1_rating)
responses$task10_profile2_rating <- ifelse(responses$Q283_2!="", interest_recode(responses$Q283_2), responses$task10_profile2_rating)
responses$task10_profile3_rating <- ifelse(responses$Q283_3!="", interest_recode(responses$Q283_3), responses$task10_profile3_rating)
responses$task10_profile1_choice <- ifelse(responses$Q284=="Destination 1", 1, responses$task10_profile1_choice)
responses$task10_profile1_choice <- ifelse(responses$Q284!="Destination 1" & responses$Q284!="", 0, responses$task10_profile1_choice)
responses$task10_profile2_choice <- ifelse(responses$Q284=="Destination 2", 1, responses$task10_profile2_choice)
responses$task10_profile2_choice <- ifelse(responses$Q284!="Destination 2" & responses$Q284!="", 0, responses$task10_profile2_choice)
responses$task10_profile3_choice <- ifelse(responses$Q284=="Destination 3", 1, responses$task10_profile3_choice)
responses$task10_profile3_choice <- ifelse(responses$Q284!="Destination 3" & responses$Q284!="", 0, responses$task10_profile3_choice)

# Now that all attribute-levels and outcome measures are recoded, we need to 
# convert the data format from wide to long.  The following code creates a 
# separate data frame for each of the three profiles in each of the ten tasks, 
# then binds them together into a long data frame

responses_task1_profile1 <- subset(responses, select = c(ResponseId, 
                                                         task1_profile1_temp,
                                                         task1_profile1_attractions,
                                                         task1_profile1_traveltime,
                                                         task1_profile1_preselec,
                                                         task1_profile1_recentnews,
                                                         task1_profile1_community,
                                                         task1_profile1_rating,
                                                         task1_profile1_choice))
responses_task1_profile1$task <- 1
responses_task1_profile1$profile <- 1
colnames(responses_task1_profile1) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task1_profile2 <- subset(responses, select = c(ResponseId, 
                                                         task1_profile2_temp,
                                                         task1_profile2_attractions,
                                                         task1_profile2_traveltime,
                                                         task1_profile2_preselec,
                                                         task1_profile2_recentnews,
                                                         task1_profile2_community,
                                                         task1_profile2_rating,
                                                         task1_profile2_choice))
responses_task1_profile2$task <- 1
responses_task1_profile2$profile <- 2
colnames(responses_task1_profile2) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task1_profile3 <- subset(responses, select = c(ResponseId, 
                                                         task1_profile3_temp,
                                                         task1_profile3_attractions,
                                                         task1_profile3_traveltime,
                                                         task1_profile3_preselec,
                                                         task1_profile3_recentnews,
                                                         task1_profile3_community,
                                                         task1_profile3_rating,
                                                         task1_profile3_choice))
responses_task1_profile3$task <- 1
responses_task1_profile3$profile <- 3
colnames(responses_task1_profile3) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task2_profile1 <- subset(responses, select = c(ResponseId, 
                                                         task2_profile1_temp,
                                                         task2_profile1_attractions,
                                                         task2_profile1_traveltime,
                                                         task2_profile1_preselec,
                                                         task2_profile1_recentnews,
                                                         task2_profile1_community,
                                                         task2_profile1_rating,
                                                         task2_profile1_choice))
responses_task2_profile1$task <- 2
responses_task2_profile1$profile <- 1
colnames(responses_task2_profile1) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task2_profile2 <- subset(responses, select = c(ResponseId, 
                                                         task2_profile2_temp,
                                                         task2_profile2_attractions,
                                                         task2_profile2_traveltime,
                                                         task2_profile2_preselec,
                                                         task2_profile2_recentnews,
                                                         task2_profile2_community,
                                                         task2_profile2_rating,
                                                         task2_profile2_choice))
responses_task2_profile2$task <- 2
responses_task2_profile2$profile <- 2
colnames(responses_task2_profile2) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task2_profile3 <- subset(responses, select = c(ResponseId, 
                                                         task2_profile3_temp,
                                                         task2_profile3_attractions,
                                                         task2_profile3_traveltime,
                                                         task2_profile3_preselec,
                                                         task2_profile3_recentnews,
                                                         task2_profile3_community,
                                                         task2_profile3_rating,
                                                         task2_profile3_choice))
responses_task2_profile3$task <- 2
responses_task2_profile3$profile <- 3
colnames(responses_task2_profile3) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task3_profile1 <- subset(responses, select = c(ResponseId, 
                                                         task3_profile1_temp,
                                                         task3_profile1_attractions,
                                                         task3_profile1_traveltime,
                                                         task3_profile1_preselec,
                                                         task3_profile1_recentnews,
                                                         task3_profile1_community,
                                                         task3_profile1_rating,
                                                         task3_profile1_choice))
responses_task3_profile1$task <- 3
responses_task3_profile1$profile <- 1
colnames(responses_task3_profile1) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task3_profile2 <- subset(responses, select = c(ResponseId, 
                                                         task3_profile2_temp,
                                                         task3_profile2_attractions,
                                                         task3_profile2_traveltime,
                                                         task3_profile2_preselec,
                                                         task3_profile2_recentnews,
                                                         task3_profile2_community,
                                                         task3_profile2_rating,
                                                         task3_profile2_choice))
responses_task3_profile2$task <- 3
responses_task3_profile2$profile <- 2
colnames(responses_task3_profile2) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task3_profile3 <- subset(responses, select = c(ResponseId, 
                                                         task3_profile3_temp,
                                                         task3_profile3_attractions,
                                                         task3_profile3_traveltime,
                                                         task3_profile3_preselec,
                                                         task3_profile3_recentnews,
                                                         task3_profile3_community,
                                                         task3_profile3_rating,
                                                         task3_profile3_choice))
responses_task3_profile3$task <- 3
responses_task3_profile3$profile <- 3
colnames(responses_task3_profile3) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task4_profile1 <- subset(responses, select = c(ResponseId, 
                                                         task4_profile1_temp,
                                                         task4_profile1_attractions,
                                                         task4_profile1_traveltime,
                                                         task4_profile1_preselec,
                                                         task4_profile1_recentnews,
                                                         task4_profile1_community,
                                                         task4_profile1_rating,
                                                         task4_profile1_choice))
responses_task4_profile1$task <- 4
responses_task4_profile1$profile <- 1
colnames(responses_task4_profile1) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task4_profile2 <- subset(responses, select = c(ResponseId, 
                                                         task4_profile2_temp,
                                                         task4_profile2_attractions,
                                                         task4_profile2_traveltime,
                                                         task4_profile2_preselec,
                                                         task4_profile2_recentnews,
                                                         task4_profile2_community,
                                                         task4_profile2_rating,
                                                         task4_profile2_choice))
responses_task4_profile2$task <- 4
responses_task4_profile2$profile <- 2
colnames(responses_task4_profile2) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task4_profile3 <- subset(responses, select = c(ResponseId, 
                                                         task4_profile3_temp,
                                                         task4_profile3_attractions,
                                                         task4_profile3_traveltime,
                                                         task4_profile3_preselec,
                                                         task4_profile3_recentnews,
                                                         task4_profile3_community,
                                                         task4_profile3_rating,
                                                         task4_profile3_choice))
responses_task4_profile3$task <- 4
responses_task4_profile3$profile <- 3
colnames(responses_task4_profile3) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task5_profile1 <- subset(responses, select = c(ResponseId, 
                                                         task5_profile1_temp,
                                                         task5_profile1_attractions,
                                                         task5_profile1_traveltime,
                                                         task5_profile1_preselec,
                                                         task5_profile1_recentnews,
                                                         task5_profile1_community,
                                                         task5_profile1_rating,
                                                         task5_profile1_choice))
responses_task5_profile1$task <- 5
responses_task5_profile1$profile <- 1
colnames(responses_task5_profile1) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task5_profile2 <- subset(responses, select = c(ResponseId, 
                                                         task5_profile2_temp,
                                                         task5_profile2_attractions,
                                                         task5_profile2_traveltime,
                                                         task5_profile2_preselec,
                                                         task5_profile2_recentnews,
                                                         task5_profile2_community,
                                                         task5_profile2_rating,
                                                         task5_profile2_choice))
responses_task5_profile2$task <- 5
responses_task5_profile2$profile <- 2
colnames(responses_task5_profile2) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task5_profile3 <- subset(responses, select = c(ResponseId, 
                                                         task5_profile3_temp,
                                                         task5_profile3_attractions,
                                                         task5_profile3_traveltime,
                                                         task5_profile3_preselec,
                                                         task5_profile3_recentnews,
                                                         task5_profile3_community,
                                                         task5_profile3_rating,
                                                         task5_profile3_choice))
responses_task5_profile3$task <- 5
responses_task5_profile3$profile <- 3
colnames(responses_task5_profile3) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task6_profile1 <- subset(responses, select = c(ResponseId, 
                                                         task6_profile1_temp,
                                                         task6_profile1_attractions,
                                                         task6_profile1_traveltime,
                                                         task6_profile1_preselec,
                                                         task6_profile1_recentnews,
                                                         task6_profile1_community,
                                                         task6_profile1_rating,
                                                         task6_profile1_choice))
responses_task6_profile1$task <- 6
responses_task6_profile1$profile <- 1
colnames(responses_task6_profile1) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task6_profile2 <- subset(responses, select = c(ResponseId, 
                                                         task6_profile2_temp,
                                                         task6_profile2_attractions,
                                                         task6_profile2_traveltime,
                                                         task6_profile2_preselec,
                                                         task6_profile2_recentnews,
                                                         task6_profile2_community,
                                                         task6_profile2_rating,
                                                         task6_profile2_choice))
responses_task6_profile2$task <- 6
responses_task6_profile2$profile <- 2
colnames(responses_task6_profile2) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task6_profile3 <- subset(responses, select = c(ResponseId, 
                                                         task6_profile3_temp,
                                                         task6_profile3_attractions,
                                                         task6_profile3_traveltime,
                                                         task6_profile3_preselec,
                                                         task6_profile3_recentnews,
                                                         task6_profile3_community,
                                                         task6_profile3_rating,
                                                         task6_profile3_choice))
responses_task6_profile3$task <- 6
responses_task6_profile3$profile <- 3
colnames(responses_task6_profile3) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task7_profile1 <- subset(responses, select = c(ResponseId, 
                                                         task7_profile1_temp,
                                                         task7_profile1_attractions,
                                                         task7_profile1_traveltime,
                                                         task7_profile1_preselec,
                                                         task7_profile1_recentnews,
                                                         task7_profile1_community,
                                                         task7_profile1_rating,
                                                         task7_profile1_choice))
responses_task7_profile1$task <- 7
responses_task7_profile1$profile <- 1
colnames(responses_task7_profile1) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task7_profile2 <- subset(responses, select = c(ResponseId, 
                                                         task7_profile2_temp,
                                                         task7_profile2_attractions,
                                                         task7_profile2_traveltime,
                                                         task7_profile2_preselec,
                                                         task7_profile2_recentnews,
                                                         task7_profile2_community,
                                                         task7_profile2_rating,
                                                         task7_profile2_choice))
responses_task7_profile2$task <- 7
responses_task7_profile2$profile <- 2
colnames(responses_task7_profile2) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task7_profile3 <- subset(responses, select = c(ResponseId, 
                                                         task7_profile3_temp,
                                                         task7_profile3_attractions,
                                                         task7_profile3_traveltime,
                                                         task7_profile3_preselec,
                                                         task7_profile3_recentnews,
                                                         task7_profile3_community,
                                                         task7_profile3_rating,
                                                         task7_profile3_choice))
responses_task7_profile3$task <- 7
responses_task7_profile3$profile <- 3
colnames(responses_task7_profile3) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task8_profile1 <- subset(responses, select = c(ResponseId, 
                                                         task8_profile1_temp,
                                                         task8_profile1_attractions,
                                                         task8_profile1_traveltime,
                                                         task8_profile1_preselec,
                                                         task8_profile1_recentnews,
                                                         task8_profile1_community,
                                                         task8_profile1_rating,
                                                         task8_profile1_choice))
responses_task8_profile1$task <- 8
responses_task8_profile1$profile <- 1
colnames(responses_task8_profile1) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task8_profile2 <- subset(responses, select = c(ResponseId, 
                                                         task8_profile2_temp,
                                                         task8_profile2_attractions,
                                                         task8_profile2_traveltime,
                                                         task8_profile2_preselec,
                                                         task8_profile2_recentnews,
                                                         task8_profile2_community,
                                                         task8_profile2_rating,
                                                         task8_profile2_choice))
responses_task8_profile2$task <- 8
responses_task8_profile2$profile <- 2
colnames(responses_task8_profile2) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task8_profile3 <- subset(responses, select = c(ResponseId, 
                                                         task8_profile3_temp,
                                                         task8_profile3_attractions,
                                                         task8_profile3_traveltime,
                                                         task8_profile3_preselec,
                                                         task8_profile3_recentnews,
                                                         task8_profile3_community,
                                                         task8_profile3_rating,
                                                         task8_profile3_choice))
responses_task8_profile3$task <- 8
responses_task8_profile3$profile <- 3
colnames(responses_task8_profile3) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task9_profile1 <- subset(responses, select = c(ResponseId, 
                                                         task9_profile1_temp,
                                                         task9_profile1_attractions,
                                                         task9_profile1_traveltime,
                                                         task9_profile1_preselec,
                                                         task9_profile1_recentnews,
                                                         task9_profile1_community,
                                                         task9_profile1_rating,
                                                         task9_profile1_choice))
responses_task9_profile1$task <- 9
responses_task9_profile1$profile <- 1
colnames(responses_task9_profile1) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task9_profile2 <- subset(responses, select = c(ResponseId, 
                                                         task9_profile2_temp,
                                                         task9_profile2_attractions,
                                                         task9_profile2_traveltime,
                                                         task9_profile2_preselec,
                                                         task9_profile2_recentnews,
                                                         task9_profile2_community,
                                                         task9_profile2_rating,
                                                         task9_profile2_choice))
responses_task9_profile2$task <- 9
responses_task9_profile2$profile <- 2
colnames(responses_task9_profile2) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task9_profile3 <- subset(responses, select = c(ResponseId, 
                                                         task9_profile3_temp,
                                                         task9_profile3_attractions,
                                                         task9_profile3_traveltime,
                                                         task9_profile3_preselec,
                                                         task9_profile3_recentnews,
                                                         task9_profile3_community,
                                                         task9_profile3_rating,
                                                         task9_profile3_choice))
responses_task9_profile3$task <- 9
responses_task9_profile3$profile <- 3
colnames(responses_task9_profile3) <- c("ResponseId", "temp", "attractions",
                                        "traveltime", "preselec", "recentnews",
                                        "community", "rating", "choice",
                                        "task", "profile")

responses_task10_profile1 <- subset(responses, select = c(ResponseId, 
                                                          task10_profile1_temp,
                                                          task10_profile1_attractions,
                                                          task10_profile1_traveltime,
                                                          task10_profile1_preselec,
                                                          task10_profile1_recentnews,
                                                          task10_profile1_community,
                                                          task10_profile1_rating,
                                                          task10_profile1_choice))
responses_task10_profile1$task <- 10
responses_task10_profile1$profile <- 1
colnames(responses_task10_profile1) <- c("ResponseId", "temp", "attractions",
                                         "traveltime", "preselec", "recentnews",
                                         "community", "rating", "choice",
                                         "task", "profile")

responses_task10_profile2 <- subset(responses, select = c(ResponseId, 
                                                          task10_profile2_temp,
                                                          task10_profile2_attractions,
                                                          task10_profile2_traveltime,
                                                          task10_profile2_preselec,
                                                          task10_profile2_recentnews,
                                                          task10_profile2_community,
                                                          task10_profile2_rating,
                                                          task10_profile2_choice))
responses_task10_profile2$task <- 10
responses_task10_profile2$profile <- 2
colnames(responses_task10_profile2) <- c("ResponseId", "temp", "attractions",
                                         "traveltime", "preselec", "recentnews",
                                         "community", "rating", "choice",
                                         "task", "profile")

responses_task10_profile3 <- subset(responses, select = c(ResponseId, 
                                                          task10_profile3_temp,
                                                          task10_profile3_attractions,
                                                          task10_profile3_traveltime,
                                                          task10_profile3_preselec,
                                                          task10_profile3_recentnews,
                                                          task10_profile3_community,
                                                          task10_profile3_rating,
                                                          task10_profile3_choice))
responses_task10_profile3$task <- 10
responses_task10_profile3$profile <- 3
colnames(responses_task10_profile3) <- c("ResponseId", "temp", "attractions",
                                         "traveltime", "preselec", "recentnews",
                                         "community", "rating", "choice",
                                         "task", "profile")

responses_stacked <- rbind(responses_task1_profile1, responses_task1_profile2, responses_task1_profile3,
                           responses_task2_profile1, responses_task2_profile2, responses_task2_profile3,
                           responses_task3_profile1, responses_task3_profile2, responses_task3_profile3,
                           responses_task4_profile1, responses_task4_profile2, responses_task4_profile3,
                           responses_task5_profile1, responses_task5_profile2, responses_task5_profile3,
                           responses_task6_profile1, responses_task6_profile2, responses_task6_profile3,
                           responses_task7_profile1, responses_task7_profile2, responses_task7_profile3,
                           responses_task8_profile1, responses_task8_profile2, responses_task8_profile3,
                           responses_task9_profile1, responses_task9_profile2, responses_task9_profile3,
                           responses_task10_profile1, responses_task10_profile2, responses_task10_profile3)

# releveling the baseline levels for each attribute
responses_stacked$temp <- relevel(as.factor(responses_stacked$temp), ref = "64")
responses_stacked$attractions <- relevel(as.factor(responses_stacked$attractions), ref = "Amusement parks")
responses_stacked$traveltime <- relevel(as.factor(responses_stacked$traveltime), ref = "Less than 2 hours")
responses_stacked$preselec <- relevel(as.factor(responses_stacked$preselec), ref = "Donald Trump won by a large margin")
responses_stacked$recentnews <- relevel(as.factor(responses_stacked$recentnews), ref = "State legislature formed a commission to study ways to stimulate economic growth")
responses_stacked$community <- relevel(as.factor(responses_stacked$community), ref = "Rural")

# subsetting out of the original data frame the respondent level-demos, then 
# merging back into the long data frame the respondent demos for each profile
# observation
resp_demos <- subset(responses, select = c("ResponseId", "pid3",
                                           "gender", "income",
                                           "age",
                                           "age_bin", "educ",
                                           "ideology", "white_nh",
                                           "white_h", "black_nh",
                                           "black_h", "asian",
                                           "other",
                                           "region",
                                           "attention1",
                                           "attention2",
                                           "attentiveness"))

responses_stacked <- merge(responses_stacked, resp_demos, by = "ResponseId")

# keep only respondents who offered at least one rating or choice
responses_stacked <- responses_stacked[which((!is.na(responses_stacked$rating)|
                                                !is.na(responses_stacked$choice))),]

# to create survey weights for robustness checks, we needed to have an alternative
# recoding of the demographic characteristics as provided by Lucid; the below
# code creates those alternative recodings for age, race, and ethnicity

responses_stacked$age_bin_lucid <- ifelse(as.numeric(responses_stacked$age)<25, 1, NA)
responses_stacked$age_bin_lucid <- ifelse(as.numeric(responses_stacked$age)>=25 & as.numeric(responses_stacked$age)<35, 2, responses_stacked$age_bin_lucid)
responses_stacked$age_bin_lucid <- ifelse(as.numeric(responses_stacked$age)>=35 & as.numeric(responses_stacked$age)<45, 3, responses_stacked$age_bin_lucid)
responses_stacked$age_bin_lucid <- ifelse(as.numeric(responses_stacked$age)>=45 & as.numeric(responses_stacked$age)<65, 4, responses_stacked$age_bin_lucid)
responses_stacked$age_bin_lucid <- ifelse(as.numeric(responses_stacked$age)>=65, 5, responses_stacked$age_bin_lucid)

responses_stacked$hispanic_lucid <- ifelse(responses_stacked$white_h==1 | responses_stacked$black_h==1, 1, 0)
responses_stacked$other_lucid <- ifelse(responses_stacked$asian==1 | responses_stacked$other==1, 1, 0)

responses_stacked$raceeth_lucid <- ifelse(responses_stacked$white_nh==1, 1, NA)
responses_stacked$raceeth_lucid <- ifelse(responses_stacked$black_nh==1, 2, responses_stacked$raceeth_lucid)
responses_stacked$raceeth_lucid <- ifelse(responses_stacked$hispanic_lucid==1, 3, responses_stacked$raceeth_lucid)
responses_stacked$raceeth_lucid <- ifelse(responses_stacked$other_lucid==1, 4, responses_stacked$raceeth_lucid)

fwrite(responses_stacked, "Study1_Final.csv", quote = "auto", na = NA)